Files
kotlin-fork/js/js.translator/testData/box/native/exception.kt
T
2018-04-19 13:17:28 +03:00

13 lines
360 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1110
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"
}
}