[JS IR] Add properties lazy initialization with multiple modules

[JS IR] Move tests into compiler/testData

[JS IR] Add cyclic dependencies with lazy property initialization

[JS IR] Add test on not initialization in case of call non properties (classed, objects, enum classes, const vals)

[JS IR] Add initialization through top level

[JS IR] Ignore enum getInstance function in property lazy initialization

[JS IR] Use let function with useful result instead of pure apply and also

[JS IR] Remove duplicated tests in js.translator
This commit is contained in:
Ilya Goncharov
2020-11-24 17:19:15 +03:00
parent 6cb573cb45
commit 697b2b02f1
19 changed files with 335 additions and 67 deletions
@@ -0,0 +1,10 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// PROPERTY_LAZY_INITIALIZATION
// MODULE: lib1
var log = ""
val a = 1.also { log += "a" }
val b = 2.also { log += "b" }
// MODULE: main(lib1)
fun box(): String = if (log + a == "ab1") "OK" else "fail"