diff --git a/js/js.translator/testData/box/inlineMultiModule/kt16160.kt b/js/js.translator/testData/box/inlineMultiModule/kt16160.kt index 7feb69f4861..9c8b9033daf 100644 --- a/js/js.translator/testData/box/inlineMultiModule/kt16160.kt +++ b/js/js.translator/testData/box/inlineMultiModule/kt16160.kt @@ -1,25 +1,4 @@ // EXPECTED_REACHABLE_NODES: 1300 -// MODULE: main(module2) -// FILE: main.kt - -// CHECK_CONTAINS_NO_CALLS: box except=foo;bar;toString TARGET_BACKENDS=JS - -import A.test - -fun box(): String { - if (A.test() != 3) return "A.test()" + A.test() - if (B.test() != 6) return "B.test()" + B.test() - if (B().foo() != 4) return "B().foo()" + B().foo() - if (test() != 3) return "[A.]test()" + test() - if (test2() != 3) return "test2()" + test2() - if (A.test2() != 3) return "A.test2()" + A.test2() - if (B.test2() != 2) return "B.test2()" + B.test2() - if (B.C.test() != 4) return "B.C.test()" + B.C.test() - if (D().foo2() != 4) return "D().foo2()" + D().foo2() - if (D.test() != 4) return "D.test()" + D.test() - return "OK" -} - // MODULE: module2 // FILE: module2.kt @@ -56,4 +35,25 @@ class D: B() { inline fun test2() = foo() + bar() inline fun A.test2() = foo() + B.bar() -inline fun B.Companion.test2() = bar() \ No newline at end of file +inline fun B.Companion.test2() = bar() + +// MODULE: main(module2) +// FILE: main.kt + +// CHECK_CONTAINS_NO_CALLS: box except=foo;bar;toString TARGET_BACKENDS=JS + +import A.test + +fun box(): String { + if (A.test() != 3) return "A.test()" + A.test() + if (B.test() != 6) return "B.test()" + B.test() + if (B().foo() != 4) return "B().foo()" + B().foo() + if (test() != 3) return "[A.]test()" + test() + if (test2() != 3) return "test2()" + test2() + if (A.test2() != 3) return "A.test2()" + A.test2() + if (B.test2() != 2) return "B.test2()" + B.test2() + if (B.C.test() != 4) return "B.C.test()" + B.C.test() + if (D().foo2() != 4) return "D().foo2()" + D().foo2() + if (D.test() != 4) return "D.test()" + D.test() + return "OK" +} diff --git a/js/js.translator/testData/box/multiModule/moduleAndVariableNameClash.kt b/js/js.translator/testData/box/multiModule/moduleAndVariableNameClash.kt index 6cb13e6f081..5796373951e 100644 --- a/js/js.translator/testData/box/multiModule/moduleAndVariableNameClash.kt +++ b/js/js.translator/testData/box/multiModule/moduleAndVariableNameClash.kt @@ -1,5 +1,10 @@ // KJS_WITH_FULL_RUNTIME // EXPECTED_REACHABLE_NODES: 1283 +// MODULE: module1 +// FILE: module1.kt + +fun bar() = "bar" + // MODULE: main(module1) // FILE: main.kt @@ -9,8 +14,3 @@ fun box(): String { return "OK" } - -// MODULE: module1 -// FILE: module1.kt - -fun bar() = "bar" \ No newline at end of file diff --git a/js/js.translator/testData/box/multiModule/privateInterfaceNameClash.kt b/js/js.translator/testData/box/multiModule/privateInterfaceNameClash.kt index 92878a92510..eb7e07833eb 100644 --- a/js/js.translator/testData/box/multiModule/privateInterfaceNameClash.kt +++ b/js/js.translator/testData/box/multiModule/privateInterfaceNameClash.kt @@ -20,7 +20,7 @@ interface B { fun bar() = foo() } -// MODULE: main(lib1,lib2) +// MODULE: main(lib1, lib2) // FILE: main.kt package main diff --git a/js/js.translator/testData/box/multiModule/useElementsFromDefaultPackageInAnotherModule.kt b/js/js.translator/testData/box/multiModule/useElementsFromDefaultPackageInAnotherModule.kt index edb11e4025a..b697a69186d 100644 --- a/js/js.translator/testData/box/multiModule/useElementsFromDefaultPackageInAnotherModule.kt +++ b/js/js.translator/testData/box/multiModule/useElementsFromDefaultPackageInAnotherModule.kt @@ -1,5 +1,12 @@ // KJS_WITH_FULL_RUNTIME // EXPECTED_REACHABLE_NODES: 1285 +// MODULE: module1 +// FILE: module1.kt + +public fun f(s: String): String = "${s}: invoked from module" + +public class A(val x: Int) + // MODULE: main(module1) // FILE: main.kt @@ -10,10 +17,3 @@ fun box(): String { return "OK" } - -// MODULE: module1 -// FILE: module1.kt - -public fun f(s: String): String = "${s}: invoked from module" - -public class A(val x: Int) \ No newline at end of file