[K/JS] Add support of compilation with ES-classes

This commit is contained in:
Artem Kobzar
2023-01-17 18:14:17 +00:00
committed by Space Team
parent 8d728d4f53
commit 71486a321c
239 changed files with 57567 additions and 1658 deletions
+1
View File
@@ -1,4 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1288
// IGNORE_BACKEND: JS_IR_ES6
// CHECK_CONTAINS_NO_CALLS: box except=equals;Baz_getInstance;callLocal;callLocalExtension TARGET_BACKENDS=JS
// CHECK_CONTAINS_NO_CALLS: box except=Foo_getInstance;Bar;Baz_getInstance;callLocal;callLocalExtension IGNORED_BACKENDS=JS
// CHECK_CONTAINS_NO_CALLS: callLocal
@@ -1,14 +1,14 @@
// EXPECTED_REACHABLE_NODES: 1285
package foo
// CHECK_CONTAINS_NO_CALLS: myMultiply except=A;imul
// CHECK_CONTAINS_NO_CALLS: myMultiply except=A;imul;new_foo_A_16tm4z_k$
internal class A(val a: Int)
internal inline fun <T, R> with2(receiver: T, arg1: R, arg2: R, f: T.(R, R) -> R): R = receiver.f(arg1, arg2)
// CHECK_BREAKS_COUNT: function=myMultiply count=0 TARGET_BACKENDS=JS_IR
// CHECK_LABELS_COUNT: function=myMultiply name=$l$block count=0 TARGET_BACKENDS=JS_IR
// CHECK_BREAKS_COUNT: function=myMultiply count=0 TARGET_BACKENDS=JS_IR,JS_IR_ES6
// CHECK_LABELS_COUNT: function=myMultiply name=$l$block count=0 TARGET_BACKENDS=JS_IR,JS_IR_ES6
internal fun myMultiply(a: Int, b: Int, c: Int): Int = with2(A(a), b, c) { x, y -> a*x*y }
fun box(): String {
+1 -1
View File
@@ -209,7 +209,7 @@ fun testNullableUnderlyingType() {
caseJsEq()
}
// CHECK_NEW_COUNT: function=testUnderlyingWithEqualsOverride count=4
// CHECK_NEW_COUNT: function=testUnderlyingWithEqualsOverride count=4 TARGET_BACKENDS=JS_IR
// CHECK_CALLED_IN_SCOPE: scope=testUnderlyingWithEqualsOverride function=equals
fun testUnderlyingWithEqualsOverride() {
val x0 = ClassUnderlayingWithEquals(MyClass(0))