[JS IR BE] Fix and refactor interop tests

This commit is contained in:
Svyatoslav Kuzmich
2019-02-14 19:43:22 +03:00
parent 569187a751
commit a736756ceb
37 changed files with 54 additions and 58 deletions
@@ -1,3 +1,3 @@
function createWrongObject() {
return new (JS_TESTS.foo.C);
return new (JS_TESTS.C);
}
@@ -1,7 +1,6 @@
// IGNORE_BACKEND: JS_IR
// KJS_WITH_FULL_RUNTIME
// SKIP_MINIFICATION
// This test assumes that external JS code calls Kotlin code directly
package foo
open class A
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1289
package foo
@@ -11,11 +10,11 @@ fun bar(s: String): Int {
fun testWhen() {
global = ""
when(arrayOf(bar("A"),2,3)) {
arrayOf(1) -> println("1")
arrayOf(2) -> println("2")
else -> println("else")
arrayOf(1) -> bar("1")
arrayOf(2) -> bar("2")
else -> bar("else")
}
assertEquals("A", global)
assertEquals("Aelse", global)
}
@@ -1,4 +1,5 @@
// IGNORE_BACKEND: JS_IR
// KJS_WITH_FULL_RUNTIME
// SKIP_MINIFICATION
// This test uses eval to access root package, therefore DCE can't infer usage of corresponding functions
package foo
@@ -1,5 +1,6 @@
// LANGUAGE_VERSION: 1.3
// IGNORE_BACKEND: JS_IR
// KJS_WITH_FULL_RUNTIME
// EXPECTED_REACHABLE_NODES: 1566
package foo
@@ -1,4 +1,5 @@
// IGNORE_BACKEND: JS_IR
// KJS_WITH_FULL_RUNTIME
// EXPECTED_REACHABLE_NODES: 1323
fun <T> checkThrown(x: T, block: (T) -> Any?): Unit? {
return try {