mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 00:21:32 +00:00
1. Fix a bug in frontend when passing non-String constant led to exception 2. Fix a bug in backend when passing non-JetStringTeplate string constant led to exception 3. Avoid recomputing constant argument in backend
24 lines
604 B
Kotlin
Vendored
24 lines
604 B
Kotlin
Vendored
val a = "1"
|
|
|
|
fun nonConst(): String = "1"
|
|
|
|
fun test() {
|
|
val b = "b"
|
|
|
|
js(a)
|
|
js((b))
|
|
js(("c"))
|
|
js(<!CONSTANT_EXPECTED_TYPE_MISMATCH, JSCODE_ARGUMENT_SHOULD_BE_CONSTANT!>3<!>)
|
|
js(<!TYPE_MISMATCH, JSCODE_ARGUMENT_SHOULD_BE_CONSTANT!>3 + 2<!>)
|
|
js(<!CONSTANT_EXPECTED_TYPE_MISMATCH, JSCODE_ARGUMENT_SHOULD_BE_CONSTANT!>1.0f<!>)
|
|
js(<!CONSTANT_EXPECTED_TYPE_MISMATCH, JSCODE_ARGUMENT_SHOULD_BE_CONSTANT!>true<!>)
|
|
js("$a")
|
|
js("${1}")
|
|
js("$b;")
|
|
js("${b}bb")
|
|
js(a + a)
|
|
js("a" + "a")
|
|
js("ccc")
|
|
|
|
js(<!JSCODE_ARGUMENT_SHOULD_BE_CONSTANT!>nonConst()<!>)
|
|
} |