[JS IR] hacky fix for local variables name binding

This commit is contained in:
Anton Bannykh
2021-10-19 01:07:47 +03:00
committed by TeamCityServer
parent e4c668462c
commit 46a23c70df
@@ -35,7 +35,9 @@ class JsGenerationContext(
currentFunction = func, currentFunction = func,
staticContext = staticContext, staticContext = staticContext,
localNames = localNames, localNames = localNames,
) ).also {
it.nameCache += nameCache
}
} }
fun newDeclaration(func: IrFunction? = null, localNames: LocalNameGenerator? = null): JsGenerationContext { fun newDeclaration(func: IrFunction? = null, localNames: LocalNameGenerator? = null): JsGenerationContext {
@@ -44,7 +46,9 @@ class JsGenerationContext(
currentFunction = func, currentFunction = func,
staticContext = staticContext, staticContext = staticContext,
localNames = localNames, localNames = localNames,
) ).also {
it.nameCache += nameCache
}
} }
private val nameCache = mutableMapOf<IrElement, JsName>() private val nameCache = mutableMapOf<IrElement, JsName>()