f48436b35e
[JS IR] Leave JsEagerInitialization until bootstrap update [JS IR] Fix js stdlib api [JS IR] Change annotation on eager initialization in sources [JS IR] Make eager initialization consistent with native Merge-request: KT-MR-5030
19 lines
305 B
Kotlin
Vendored
19 lines
305 B
Kotlin
Vendored
// TARGET_BACKEND: JS_IR
|
|
// IGNORE_BACKEND: WASM
|
|
// PROPERTY_LAZY_INITIALIZATION
|
|
|
|
// FILE: lib.kt
|
|
var z1 = false
|
|
|
|
// FILE: lib2.kt
|
|
|
|
@OptIn(kotlin.ExperimentalStdlibApi::class)
|
|
@EagerInitialization
|
|
val x = run { z1 = !z1; 42 }
|
|
|
|
val y = run { 73 }
|
|
|
|
fun box(): String {
|
|
return if (z1) "OK" else "fail"
|
|
}
|