Files
kotlin-fork/js/js.translator/testData/box/propertyAccess/lazyInitializationPure.kt
T
Ilya Goncharov efee3ea648 [JS IR] - Remove file lowering declarations from lowering phases
- rename fileToPurenessInitializers onto fileToInitializerPureness
- remove redundant check on top-level property

[JS IR] Rename initialis* to initializ* for consistency

[JS IR] Move propertyLazyInitialization property to context from configuration

[JS IR] Add test on lazy initialization properties order

[JS IR] Add multi module for lazy initialization of properties

[JS IR] Move tests onto js.translator

[JS IR] Rename fileToInitializerPureness according to context name

^KT-43222 fixed
2020-11-24 12:33:44 +03:00

32 lines
590 B
Kotlin
Vendored

// IGNORE_BACKEND: JS
// PROPERTY_LAZY_INITIALIZATION
// FILE: A.kt
val a = "A"
// FILE: B.kt
val b = "B".apply {}
val c = b
// FILE: C.kt
val d = "D".apply {}
val e = d
// FILE: main.kt
fun box(): String {
// Get only e to initialize all properties in file
e
return if (
js("a") === "A" &&
js("typeof b") == "undefined" &&
js("typeof c") == "undefined" &&
js("d") === "D" &&
js("e") === "D"
)
"OK"
else "a = ${js("a")}; typeof b = ${js("typeof b")}; typeof c = ${js("typeof c")}; d = ${js("d")}; e = ${js("e")}"
}