[JS IR BE] Fix enum entry initialization
Keep helper fields uninitialized. This way thier initialization would not depend on field initialization order.
This commit is contained in:
+5
@@ -6804,6 +6804,11 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/regression"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("enumEntryInitOrder.kt")
|
||||
public void testEnumEntryInitOrder() throws Exception {
|
||||
runTest("js/js.translator/testData/box/regression/enumEntryInitOrder.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt2470.kt")
|
||||
public void testKt2470() throws Exception {
|
||||
runTest("js/js.translator/testData/box/regression/kt2470.kt");
|
||||
|
||||
+5
@@ -6859,6 +6859,11 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/regression"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("enumEntryInitOrder.kt")
|
||||
public void testEnumEntryInitOrder() throws Exception {
|
||||
runTest("js/js.translator/testData/box/regression/enumEntryInitOrder.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt2470.kt")
|
||||
public void testKt2470() throws Exception {
|
||||
runTest("js/js.translator/testData/box/regression/kt2470.kt");
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1309
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
|
||||
enum class E { A, B }
|
||||
val x: Any = E.A
|
||||
|
||||
fun box(): String {
|
||||
if (x !== E.A) return "Fail"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user