diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt index c65f3e48024..046a3bb5f22 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt @@ -187,7 +187,9 @@ fun compileIr( } irFactory.stageController = object : StageController(irFactory.stageController.currentStage) {} } else { - jsPhases.invokeToplevel(phaseConfig, context, allModules) + (irFactory.stageController as? WholeWorldStageController)?.let { + lowerPreservingTags(allModules, context, phaseConfig, it) + } ?: jsPhases.invokeToplevel(phaseConfig, context, allModules) } }