Files
kotlin-fork/compiler/testData/codegen/box/properties/lazyInitializationPure.kt
T
2020-11-24 12:33:43 +03:00

32 lines
544 B
Kotlin
Vendored

// TARGET_BACKEND: JS_IR
// PROPERTY_LAZY_INITIALISATION
// 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 {
d
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")}"
}