Test Throwable properties in JS, don't work as expected, commiting as ignored.
#KT-10911
This commit is contained in:
@@ -74,4 +74,8 @@ public final class StandardClassesTest extends SingleFileTranslationTest {
|
|||||||
public void testHashMapTypeOfElement() throws Exception {
|
public void testHashMapTypeOfElement() throws Exception {
|
||||||
checkFooBoxIsOk();
|
checkFooBoxIsOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ignore_testThrowableImpl() throws Exception {
|
||||||
|
checkFooBoxIsOk();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
class MyThrowable(message: String? = null) : java.lang.Exception(message) {
|
||||||
|
|
||||||
|
override val message: String?
|
||||||
|
get() = "My message: " + super.message
|
||||||
|
|
||||||
|
override val cause: Throwable?
|
||||||
|
get() = super.cause ?: this
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
try {
|
||||||
|
throw MyThrowable("test")
|
||||||
|
} catch (t: MyThrowable) {
|
||||||
|
if (t.cause != t) return "fail t.cause"
|
||||||
|
if (t.message != "My message: test") return "fail t.message"
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
return "fail: MyThrowable wasn't catched."
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user