diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsPropertyAccessorInlineLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsPropertyAccessorInlineLowering.kt index acc48c4e325..dc1366cd8de 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsPropertyAccessorInlineLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsPropertyAccessorInlineLowering.kt @@ -19,22 +19,28 @@ class JsPropertyAccessorInlineLowering( if (!isSafeToInlineInClosedWorld()) return false - if (isConst) - return true + // TODO: teach the deserializer to load constant property initializers + val accessFile = accessContainer.fileOrNull ?: return false + val file = fileOrNull ?: return false - return when (context.granularity) { - JsGenerationGranularity.WHOLE_PROGRAM -> - true - JsGenerationGranularity.PER_MODULE -> { - val accessModule = accessContainer.fileOrNull?.module ?: return false - val module = fileOrNull?.module ?: return false - accessModule == module - } - JsGenerationGranularity.PER_FILE -> - // Not inlining because - // 1. we need a way to distinguish per-file generation units - // 2. per-file mode intended for debug builds only at the moment - false - } + return accessFile == file + +// if (isConst) +// return true +// +// return when (context.granularity) { +// JsGenerationGranularity.WHOLE_PROGRAM -> +// true +// JsGenerationGranularity.PER_MODULE -> { +// val accessModule = accessContainer.fileOrNull?.module ?: return false +// val module = fileOrNull?.module ?: return false +// accessModule == module +// } +// JsGenerationGranularity.PER_FILE -> +// // Not inlining because +// // 1. we need a way to distinguish per-file generation units +// // 2. per-file mode intended for debug builds only at the moment +// false +// } } } \ No newline at end of file