[JS IR] Optimize JS AST scopes memory consumption

This commit is contained in:
Alexander Korepanov
2022-08-25 17:06:28 +02:00
committed by Space
parent bf53273b84
commit ea34e10b67
3 changed files with 24 additions and 14 deletions
@@ -14,13 +14,16 @@ import org.jetbrains.kotlin.js.backend.ast.JsLocation
import org.jetbrains.kotlin.js.backend.ast.JsName
import org.jetbrains.kotlin.js.backend.ast.JsScope
val emptyScope: JsScope
get() = object : JsScope("nil") {
override fun doCreateName(ident: String): JsName {
error("Trying to create name in empty scope")
}
val emptyScope: JsScope = object : JsScope("nil") {
override fun doCreateName(ident: String): JsName {
error("Trying to create name in empty scope")
}
override fun copyOwnNames(other: JsScope?) {
error("Trying to copy names to empty scope")
}
}
class JsGenerationContext(
val currentFile: IrFile,
val currentFunction: IrFunction?,