cb3b1f8ae2
Fixed by outlining JS code that uses Kotlin variables making usages of these locals explicit and preventing bugs due to one-sided variable renaming. This prevents using Kotlin variables as lvalue in JS code.
28 lines
444 B
Kotlin
Vendored
28 lines
444 B
Kotlin
Vendored
// EXPECTED_REACHABLE_NODES: 1282
|
|
// IGNORE_BACKEND: JS_IR
|
|
package foo
|
|
|
|
// CHECK_LABELS_COUNT: function=box name=block count=2
|
|
|
|
fun box(): String {
|
|
var i = 0
|
|
var j = 0
|
|
|
|
js("""
|
|
block: {
|
|
i++;
|
|
break block;
|
|
i++;
|
|
}
|
|
|
|
block: {
|
|
j++;
|
|
break block;
|
|
j++;
|
|
}
|
|
""")
|
|
|
|
assertEquals(1, i, "i")
|
|
assertEquals(1, j, "j")
|
|
return "OK"
|
|
} |