JS: allow to inherit external class from kotlin.Throwable. See KT-15336

This commit is contained in:
Alexey Andreev
2016-12-28 15:43:10 +03:00
parent 847ec9e550
commit 51e5b5aac7
3 changed files with 19 additions and 5 deletions
+11
View File
@@ -0,0 +1,11 @@
external class TypeError(message: String?, fileName: String? = definedExternally, lineNumber: Int? = definedExternally) : Throwable
fun box(): String {
try {
js("null.foo()")
return "fail: expected exception not thrown"
}
catch (e: TypeError) {
return "OK"
}
}