JS: switch off inlined local declaration deduplication (KT-30877 fixed)
(cherry picked from commit 681e8dd9682afdea822af8e0ad76c9242831e639)
This commit is contained in:
@@ -190,7 +190,7 @@ class Merger(
|
||||
return rootNode
|
||||
}
|
||||
|
||||
private val importedFunctionWrappers = mutableMapOf<String, JsGlobalBlock>()
|
||||
private val additionalFakeOverrides = mutableListOf<JsStatement>()
|
||||
|
||||
private fun mergeNames() {
|
||||
for (fragment in fragments) {
|
||||
@@ -204,15 +204,23 @@ class Merger(
|
||||
}
|
||||
}
|
||||
|
||||
fragment.inlinedLocalDeclarations.forEach { (_, imports) ->
|
||||
imports.statements.forEach { s ->
|
||||
if (s.isFakeOverrideAssignment()) {
|
||||
additionalFakeOverrides += s
|
||||
} else {
|
||||
declarationBlock.statements += s
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declarationBlock.statements += fragment.declarationBlock
|
||||
initializerBlock.statements += fragment.initializerBlock
|
||||
fragment.tryUpdateTests()
|
||||
fragment.tryUpdateMain()
|
||||
addExportStatements(fragment)
|
||||
|
||||
fragment.inlinedLocalDeclarations.forEach { (tag, imports) ->
|
||||
importedFunctionWrappers.putIfAbsent(tag, imports)
|
||||
}
|
||||
|
||||
|
||||
classes += fragment.classes
|
||||
}
|
||||
@@ -241,18 +249,6 @@ class Merger(
|
||||
this += importBlock.statements
|
||||
addClassPrototypes(this)
|
||||
|
||||
// TODO better placing?
|
||||
val additionalFakeOverrides = mutableListOf<JsStatement>()
|
||||
importedFunctionWrappers.values.forEach { block ->
|
||||
block.statements.forEach { s ->
|
||||
if (s.isFakeOverrideAssignment()) {
|
||||
additionalFakeOverrides += s
|
||||
} else {
|
||||
this += s
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this += declarationBlock.statements
|
||||
this += exportBlock.statements
|
||||
addClassPostDeclarations(this)
|
||||
|
||||
Reference in New Issue
Block a user