From 6a40a7e471da22e13dd188db6b425baa78668c77 Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Tue, 25 Oct 2022 15:05:11 +0200 Subject: [PATCH] [JS IR] Don't forget to enable lazy property initialization --- .../org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt | 2 +- .../properties/sideEffectInTopLevelInitializerMultiModule.kt | 1 + js/js.translator/testData/lineNumbers/delegation.kt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt index cef9db29765..10cc0cffb97 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt @@ -161,7 +161,7 @@ class JsIrBackendContext( override val reflectionSymbols: ReflectionSymbols get() = intrinsics.reflectionSymbols override val propertyLazyInitialization: PropertyLazyInitialization = PropertyLazyInitialization( - enabled = configuration.getBoolean(JSConfigurationKeys.PROPERTY_LAZY_INITIALIZATION), + enabled = configuration.get(JSConfigurationKeys.PROPERTY_LAZY_INITIALIZATION, true), eagerInitialization = symbolTable.referenceClass(getJsInternalClass("EagerInitialization")) ) diff --git a/compiler/testData/codegen/box/properties/sideEffectInTopLevelInitializerMultiModule.kt b/compiler/testData/codegen/box/properties/sideEffectInTopLevelInitializerMultiModule.kt index f71d5a096f7..be358638c1a 100644 --- a/compiler/testData/codegen/box/properties/sideEffectInTopLevelInitializerMultiModule.kt +++ b/compiler/testData/codegen/box/properties/sideEffectInTopLevelInitializerMultiModule.kt @@ -2,6 +2,7 @@ // FIR status: not supported in JVM // IGNORE_BACKEND: JVM, JVM_IR // IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: WASM // WASM_MUTE_REASON: LAZY_INIT_PROPERTIES // IGNORE_LIGHT_ANALYSIS diff --git a/js/js.translator/testData/lineNumbers/delegation.kt b/js/js.translator/testData/lineNumbers/delegation.kt index 1229f7c4fb9..b0fa583d90d 100644 --- a/js/js.translator/testData/lineNumbers/delegation.kt +++ b/js/js.translator/testData/lineNumbers/delegation.kt @@ -19,4 +19,4 @@ val o = object : I { } // LINES(JS): 1 2 3 2 2 2 2 2 2 2 * 11 12 12 12 15 15 15 16 18 17 17 -// LINES(JS_IR): 11 11 11 11 * 1 1 3 3 1 1 1 1 1 1 1 1 1 5 11 11 12 12 12 16 17 17 15 15 15 11 11 +// LINES(JS_IR): 11 11 * 11 11 * 1 1 3 3 1 1 1 1 1 1 1 1 1 5 11 11 12 12 12 16 17 17 15 15 15 * 11