JS: make kotlin.Throwable = Error. See KT-15312

This commit is contained in:
Alexey Andreev
2016-12-29 13:37:30 +03:00
parent c565697e77
commit f34093db9f
18 changed files with 299 additions and 52 deletions
@@ -0,0 +1,9 @@
fun box(): String {
var t = Throwable("O", Throwable("K"))
if (t.message != "O" || t.cause?.message != "K") return "fail1"
t = Throwable(Throwable("OK"))
if (t.message != null || t.cause?.message != "OK") return "fail2"
return "OK"
}
@@ -0,0 +1,3 @@
public final class ThrowableCauseKt {
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
}
@@ -16223,6 +16223,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
doTest(fileName);
}
@TestMetadata("throwableCause.kt")
public void testThrowableCause() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/specialBuiltins/throwableCause.kt");
doTest(fileName);
}
@TestMetadata("throwableImpl.kt")
public void testThrowableImpl() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/specialBuiltins/throwableImpl.kt");
@@ -16223,6 +16223,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("throwableCause.kt")
public void testThrowableCause() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/specialBuiltins/throwableCause.kt");
doTest(fileName);
}
@TestMetadata("throwableImpl.kt")
public void testThrowableImpl() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/specialBuiltins/throwableImpl.kt");
@@ -16223,6 +16223,12 @@ public class LightAnalysisModeCodegenTestGenerated extends AbstractLightAnalysis
doTest(fileName);
}
@TestMetadata("throwableCause.kt")
public void testThrowableCause() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/specialBuiltins/throwableCause.kt");
doTest(fileName);
}
@TestMetadata("throwableImpl.kt")
public void testThrowableImpl() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/specialBuiltins/throwableImpl.kt");