diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/IntrinsicifyCallsLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/IntrinsicifyCallsLowering.kt index 4c292ae63a9..fe4ef119667 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/IntrinsicifyCallsLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/IntrinsicifyCallsLowering.kt @@ -260,7 +260,7 @@ class IntrinsicifyCallsLowering(private val context: JsIrBackendContext) : FileL put(Name.identifier("equals"), ::transformEqualsMethodCall) } - dynamicCallOriginToIrFunction.run { + dynamicCallOriginToIrFunction.apply { put(IrStatementOrigin.EXCL, context.intrinsics.jsNot) put(IrStatementOrigin.LT, context.intrinsics.jsLt) @@ -296,6 +296,8 @@ class IntrinsicifyCallsLowering(private val context: JsIrBackendContext) : FileL put(IrStatementOrigin.POSTFIX_INCR, context.intrinsics.jsPostfixInc) put(IrStatementOrigin.POSTFIX_DECR, context.intrinsics.jsPostfixDec) put(IrStatementOrigin.GET_ARRAY_ELEMENT, context.intrinsics.jsArrayGet) + // TODO add a special statement origin, e.g. SET_ARRAY_ELEMENT + put(IrStatementOrigin.EQ, context.intrinsics.jsArraySet) } } diff --git a/compiler/testData/codegen/box/arrays/hashMap.kt b/compiler/testData/codegen/box/arrays/hashMap.kt index f5aff0d311e..9c04d4911d6 100644 --- a/compiler/testData/codegen/box/arrays/hashMap.kt +++ b/compiler/testData/codegen/box/arrays/hashMap.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR operator fun HashMap.set(index: String, elem: Int?) { this.put(index, elem) } diff --git a/compiler/testData/codegen/box/arrays/kt950.kt b/compiler/testData/codegen/box/arrays/kt950.kt index 2b88d0df9b9..f9d26d44d43 100644 --- a/compiler/testData/codegen/box/arrays/kt950.kt +++ b/compiler/testData/codegen/box/arrays/kt950.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR operator fun MutableMap.set(k : K, v : V) = put(k, v) fun box() : String { diff --git a/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt index 384052fc561..fc38540ef01 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt @@ -1,4 +1,4 @@ -// IGNORE_BACKEND: JS_IR, JVM_IR +// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME class Itr : Iterator by ArrayList().iterator() diff --git a/compiler/testData/codegen/box/casts/mutableCollections/isWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/isWithMutable.kt index b6a1c326c1d..91c880e800d 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/isWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/isWithMutable.kt @@ -1,4 +1,4 @@ -// IGNORE_BACKEND: JS_IR, JVM_IR +// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME class Itr : Iterator by ArrayList().iterator() diff --git a/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt index 6da66b448dc..34f8987b825 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME class Itr : Iterator by ArrayList().iterator() diff --git a/compiler/testData/codegen/box/casts/mutableCollections/reifiedIsWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/reifiedIsWithMutable.kt index 33d91570a9e..a552f1cc54f 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/reifiedIsWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/reifiedIsWithMutable.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME class Itr : Iterator by ArrayList().iterator() diff --git a/compiler/testData/codegen/box/casts/mutableCollections/reifiedSafeAsWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/reifiedSafeAsWithMutable.kt index e6ab717d1d5..0551e381556 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/reifiedSafeAsWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/reifiedSafeAsWithMutable.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME class Itr : Iterator by ArrayList().iterator() diff --git a/compiler/testData/codegen/box/casts/mutableCollections/safeAsWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/safeAsWithMutable.kt index c17b5dd5211..cf73d582aed 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/safeAsWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/safeAsWithMutable.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME class Itr : Iterator by ArrayList().iterator() diff --git a/compiler/testData/codegen/box/classes/inheritSetAndHashSet.kt b/compiler/testData/codegen/box/classes/inheritSetAndHashSet.kt index 81808bd7937..b5799632fdf 100644 --- a/compiler/testData/codegen/box/classes/inheritSetAndHashSet.kt +++ b/compiler/testData/codegen/box/classes/inheritSetAndHashSet.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: NATIVE interface A : Set diff --git a/compiler/testData/codegen/box/classes/kt2417.kt b/compiler/testData/codegen/box/classes/kt2417.kt index 042ec97648c..fe584cce56a 100644 --- a/compiler/testData/codegen/box/classes/kt2417.kt +++ b/compiler/testData/codegen/box/classes/kt2417.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR fun box() : String{ val set = HashSet() set.add("foo") diff --git a/compiler/testData/codegen/box/collections/inSetWithSmartCast.kt b/compiler/testData/codegen/box/collections/inSetWithSmartCast.kt index 7bac2cd54f1..ee4987608d6 100644 --- a/compiler/testData/codegen/box/collections/inSetWithSmartCast.kt +++ b/compiler/testData/codegen/box/collections/inSetWithSmartCast.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME fun contains(set: Set, x: Int): Boolean = when { diff --git a/compiler/testData/codegen/box/controlStructures/kt910.kt b/compiler/testData/codegen/box/controlStructures/kt910.kt index bf069790804..a9226bbdba2 100644 --- a/compiler/testData/codegen/box/controlStructures/kt910.kt +++ b/compiler/testData/codegen/box/controlStructures/kt910.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR fun foo() : Int = try { 2 diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt index db67127bfef..872234beafb 100644 --- a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME import kotlin.test.* diff --git a/compiler/testData/codegen/box/javaInterop/notNullAssertions/mapPut.kt b/compiler/testData/codegen/box/javaInterop/notNullAssertions/mapPut.kt index 5ace5c4a6d8..c39287e7d2b 100644 --- a/compiler/testData/codegen/box/javaInterop/notNullAssertions/mapPut.kt +++ b/compiler/testData/codegen/box/javaInterop/notNullAssertions/mapPut.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR fun foo(k: K, v: V) { val map = HashMap() diff --git a/compiler/testData/codegen/box/jdk/hashMap.kt b/compiler/testData/codegen/box/jdk/hashMap.kt index 9f1ce1d4ff5..3574e445e4c 100644 --- a/compiler/testData/codegen/box/jdk/hashMap.kt +++ b/compiler/testData/codegen/box/jdk/hashMap.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR fun box(): String { val map: MutableMap = HashMap() diff --git a/compiler/testData/codegen/box/jdk/iteratingOverHashMap.kt b/compiler/testData/codegen/box/jdk/iteratingOverHashMap.kt index b943b3b4707..c7d4b0752f7 100644 --- a/compiler/testData/codegen/box/jdk/iteratingOverHashMap.kt +++ b/compiler/testData/codegen/box/jdk/iteratingOverHashMap.kt @@ -1,4 +1,4 @@ -// IGNORE_BACKEND: JS_IR, JVM_IR +// IGNORE_BACKEND: JVM_IR fun box() : String { if (!testIteratingOverMap1()) return "fail 1" diff --git a/compiler/testData/codegen/box/multiDecl/kt9828_hashMap.kt b/compiler/testData/codegen/box/multiDecl/kt9828_hashMap.kt index dceded9ff45..8793aef1b14 100644 --- a/compiler/testData/codegen/box/multiDecl/kt9828_hashMap.kt +++ b/compiler/testData/codegen/box/multiDecl/kt9828_hashMap.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME fun box(): String { diff --git a/compiler/testData/codegen/box/objects/localFunctionInObjectInitializer_kt4516.kt b/compiler/testData/codegen/box/objects/localFunctionInObjectInitializer_kt4516.kt index 4072aac689d..be7d8cdcd90 100644 --- a/compiler/testData/codegen/box/objects/localFunctionInObjectInitializer_kt4516.kt +++ b/compiler/testData/codegen/box/objects/localFunctionInObjectInitializer_kt4516.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS_IR object O { val mmmap = HashMap(); diff --git a/compiler/testData/codegen/box/ranges/contains/kt20106.kt b/compiler/testData/codegen/box/ranges/contains/kt20106.kt index 079eacd7dcc..2b2097f1e04 100644 --- a/compiler/testData/codegen/box/ranges/contains/kt20106.kt +++ b/compiler/testData/codegen/box/ranges/contains/kt20106.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME fun box(): String { diff --git a/compiler/testData/codegen/box/regressions/kt3442.kt b/compiler/testData/codegen/box/regressions/kt3442.kt index 7a273446da8..0a28219ff5f 100644 --- a/compiler/testData/codegen/box/regressions/kt3442.kt +++ b/compiler/testData/codegen/box/regressions/kt3442.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME fun box(): String { diff --git a/compiler/testData/codegen/box/regressions/resolvedCallForGetOperator.kt b/compiler/testData/codegen/box/regressions/resolvedCallForGetOperator.kt index d4e655c51a4..8b0e9bd07b0 100644 --- a/compiler/testData/codegen/box/regressions/resolvedCallForGetOperator.kt +++ b/compiler/testData/codegen/box/regressions/resolvedCallForGetOperator.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // WITH_RUNTIME val targetNameLists: Map = mapOf("1" to "OK") diff --git a/compiler/testData/codegen/box/vararg/kt581.kt b/compiler/testData/codegen/box/vararg/kt581.kt index 142845485c8..829dc640f1d 100644 --- a/compiler/testData/codegen/box/vararg/kt581.kt +++ b/compiler/testData/codegen/box/vararg/kt581.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR package whats.the.difference fun iarray(vararg a : Int) = a // BUG diff --git a/js/js.translator/testData/box/char/charConstantByUnicodeId.kt b/js/js.translator/testData/box/char/charConstantByUnicodeId.kt index 61566cb9c05..c759a022931 100644 --- a/js/js.translator/testData/box/char/charConstantByUnicodeId.kt +++ b/js/js.translator/testData/box/char/charConstantByUnicodeId.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1282 package foo diff --git a/js/js.translator/testData/box/dataClass/keyrole.kt b/js/js.translator/testData/box/dataClass/keyrole.kt index 7fc66a1d4a4..33d0bc6f6c5 100644 --- a/js/js.translator/testData/box/dataClass/keyrole.kt +++ b/js/js.translator/testData/box/dataClass/keyrole.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1317 package foo diff --git a/js/js.translator/testData/box/dataClass/privateFields.kt b/js/js.translator/testData/box/dataClass/privateFields.kt index d73980f37f2..24d28bd4614 100644 --- a/js/js.translator/testData/box/dataClass/privateFields.kt +++ b/js/js.translator/testData/box/dataClass/privateFields.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1292 package foo diff --git a/js/js.translator/testData/box/delegateProperty/metadataReferentialEquality.kt b/js/js.translator/testData/box/delegateProperty/metadataReferentialEquality.kt index d6bcf52fc4b..c638958c99e 100644 --- a/js/js.translator/testData/box/delegateProperty/metadataReferentialEquality.kt +++ b/js/js.translator/testData/box/delegateProperty/metadataReferentialEquality.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1302 import kotlin.reflect.KProperty diff --git a/js/js.translator/testData/box/dynamic/operationsWithAssignment.kt b/js/js.translator/testData/box/dynamic/operationsWithAssignment.kt index a5b99cc2791..2ad9fbd1d50 100644 --- a/js/js.translator/testData/box/dynamic/operationsWithAssignment.kt +++ b/js/js.translator/testData/box/dynamic/operationsWithAssignment.kt @@ -21,6 +21,8 @@ fun box(): String { assertEquals(9.79999999999999, b) c += a * 3 + b / n assertEquals("text1318.233333333333334", c) + a = 14 + assertEquals(14, a) return "OK" } diff --git a/js/js.translator/testData/box/dynamic/setByBrackets.kt b/js/js.translator/testData/box/dynamic/setByBrackets.kt index f7ec878895f..ca31b3283d2 100644 --- a/js/js.translator/testData/box/dynamic/setByBrackets.kt +++ b/js/js.translator/testData/box/dynamic/setByBrackets.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1231 package foo diff --git a/js/js.translator/testData/box/expression/for/overCollectionWithIndex.kt b/js/js.translator/testData/box/expression/for/overCollectionWithIndex.kt index c9e388d8cc0..32b17eca350 100644 --- a/js/js.translator/testData/box/expression/for/overCollectionWithIndex.kt +++ b/js/js.translator/testData/box/expression/for/overCollectionWithIndex.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1652 // CHECK_NOT_CALLED_IN_SCOPE: function=component1 scope=test1 // CHECK_NOT_CALLED_IN_SCOPE: function=component1 scope=test2 diff --git a/js/js.translator/testData/box/expression/when/whenWithMapRangeClause.kt b/js/js.translator/testData/box/expression/when/whenWithMapRangeClause.kt index 4585adee2cf..7340a6e42b0 100644 --- a/js/js.translator/testData/box/expression/when/whenWithMapRangeClause.kt +++ b/js/js.translator/testData/box/expression/when/whenWithMapRangeClause.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1211 package foo diff --git a/js/js.translator/testData/box/inlineEvaluationOrder/methodDecomposedWithBind.kt b/js/js.translator/testData/box/inlineEvaluationOrder/methodDecomposedWithBind.kt index 38624267865..bc999cd7a04 100644 --- a/js/js.translator/testData/box/inlineEvaluationOrder/methodDecomposedWithBind.kt +++ b/js/js.translator/testData/box/inlineEvaluationOrder/methodDecomposedWithBind.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1525 package foo diff --git a/js/js.translator/testData/box/inlineMultiFile/builders.kt b/js/js.translator/testData/box/inlineMultiFile/builders.kt index 518249c554d..960ca289e54 100644 --- a/js/js.translator/testData/box/inlineMultiFile/builders.kt +++ b/js/js.translator/testData/box/inlineMultiFile/builders.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1661 /* * Copy of JVM-backend test diff --git a/js/js.translator/testData/box/multideclaration/multiValForMap.kt b/js/js.translator/testData/box/multideclaration/multiValForMap.kt index 2ea3a107021..518017969dd 100644 --- a/js/js.translator/testData/box/multideclaration/multiValForMap.kt +++ b/js/js.translator/testData/box/multideclaration/multiValForMap.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1211 package foo diff --git a/js/js.translator/testData/box/rtti/collectionClassesIsCheck.kt b/js/js.translator/testData/box/rtti/collectionClassesIsCheck.kt index 867cf9a03d8..2b7736208fe 100644 --- a/js/js.translator/testData/box/rtti/collectionClassesIsCheck.kt +++ b/js/js.translator/testData/box/rtti/collectionClassesIsCheck.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1557 // KT-2468 ArrayList is List or HashSet is Set fails in generated JS code package foo diff --git a/js/js.translator/testData/box/standardClasses/hashMapTypeOfElement.kt b/js/js.translator/testData/box/standardClasses/hashMapTypeOfElement.kt index 1623e4f5d1b..0aa9dd7a0c5 100644 --- a/js/js.translator/testData/box/standardClasses/hashMapTypeOfElement.kt +++ b/js/js.translator/testData/box/standardClasses/hashMapTypeOfElement.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1284 package foo diff --git a/js/js.translator/testData/box/standardClasses/hashSetTypeOfElement.kt b/js/js.translator/testData/box/standardClasses/hashSetTypeOfElement.kt index 369233d103a..83374ae8aa5 100644 --- a/js/js.translator/testData/box/standardClasses/hashSetTypeOfElement.kt +++ b/js/js.translator/testData/box/standardClasses/hashSetTypeOfElement.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1300 package foo