JS backend: use special JsScope(JsDynamicScope) for names from dynamic calls instead of use containing scope to avoid the impact on local names.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package foo
|
||||
|
||||
fun assertContains(expectedName: String, f: () -> Unit) {
|
||||
val s = f.toString()
|
||||
assertTrue(s.contains(expectedName), "\"$s\" dosn't contain \"$expectedName\"")
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val d: dynamic = bar
|
||||
|
||||
val a = {
|
||||
val somethingBefore = 1
|
||||
d.somethingBefore
|
||||
}
|
||||
|
||||
assertContains("var somethingBefore = 1;", a)
|
||||
|
||||
val b = {
|
||||
d.somethingAfter
|
||||
val somethingAfter = 1
|
||||
}
|
||||
|
||||
assertContains("var somethingAfter = 1;", b)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user