[JS IR] Optimize JS AST blocks memory consumption
This commit is contained in:
committed by
Space
parent
ea34e10b67
commit
c747d0e742
@@ -423,7 +423,7 @@ private val IrModuleFragment.jsModuleName: String
|
||||
get() = name.asString().dropWhile { it == '<' }.dropLastWhile { it == '>' }
|
||||
|
||||
private fun List<JsStatement>.toJsCodeString(): String =
|
||||
JsCompositeBlock().also { it.statements += this }.toString()
|
||||
JsCompositeBlock(this).toString()
|
||||
|
||||
enum class JsGenerationGranularity {
|
||||
WHOLE_PROGRAM,
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ class JsCallTransformer(private val jsOrJsFuncCall: IrCall, private val context:
|
||||
0 -> JsEmpty
|
||||
1 -> newStatements.single().withSource(jsOrJsFuncCall, context)
|
||||
// TODO: use transparent block (e.g. JsCompositeBlock)
|
||||
else -> JsCompositeBlock().apply { statements += newStatements }
|
||||
else -> JsCompositeBlock(newStatements)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user