[JS IR BE] Fix Throwable ancestor transformation
Make sure that `message` and `cause` are properly configured - synchronize IR BE and Legacy behaviour - fix corresponding IR lowering - fix JS IR core runtime - add test - fix KT-39964
This commit is contained in:
+5
@@ -7675,6 +7675,11 @@ public class IrBoxJsES6TestGenerated extends AbstractIrBoxJsES6Test {
|
||||
public void testStringPlus() throws Exception {
|
||||
runTest("js/js.translator/testData/box/standardClasses/stringPlus.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableCtor.kt")
|
||||
public void testThrowableCtor() throws Exception {
|
||||
runTest("js/js.translator/testData/box/standardClasses/throwableCtor.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/superCall")
|
||||
|
||||
+5
@@ -7675,6 +7675,11 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
public void testStringPlus() throws Exception {
|
||||
runTest("js/js.translator/testData/box/standardClasses/stringPlus.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableCtor.kt")
|
||||
public void testThrowableCtor() throws Exception {
|
||||
runTest("js/js.translator/testData/box/standardClasses/throwableCtor.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/superCall")
|
||||
|
||||
+5
@@ -7705,6 +7705,11 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
||||
public void testStringPlus() throws Exception {
|
||||
runTest("js/js.translator/testData/box/standardClasses/stringPlus.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("throwableCtor.kt")
|
||||
public void testThrowableCtor() throws Exception {
|
||||
runTest("js/js.translator/testData/box/standardClasses/throwableCtor.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("js/js.translator/testData/box/superCall")
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1237
|
||||
|
||||
// KT-39964
|
||||
|
||||
|
||||
fun box(): String {
|
||||
val e = Throwable(null, IllegalStateException("fail"))
|
||||
if (e.message != null) return "FAIL"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user