Test Throwable properties in JS, don't work as expected, commiting as ignored.

#KT-10911
This commit is contained in:
Ilya Gorbunov
2016-02-03 21:34:08 +03:00
parent 5361f6e941
commit 17ebb36128
2 changed files with 27 additions and 0 deletions
@@ -74,4 +74,8 @@ public final class StandardClassesTest extends SingleFileTranslationTest {
public void testHashMapTypeOfElement() throws Exception {
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."
}