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:
Zalim Bashorov
2014-12-10 22:46:42 +03:00
parent af82e69214
commit 6b50d74056
4 changed files with 37 additions and 3 deletions
@@ -22,6 +22,10 @@ public fun JsObjectScope(parent: JsScope, description: String): JsObjectScope =
public class JsObjectScope(parent: JsScope, description: String, scopeId: String?) : JsScope(parent, description, scopeId)
public object JsDynamicScope : JsScope(null, "Scope for dynamic declarations", null) {
override fun doCreateName(name: String) = JsName(this, name)
}
public class JsFunctionScope(parent: JsScope, description: String) : JsScope(parent, description, null) {
private val labelScopes = Stack<LabelScope>()