Files
kotlin-fork/js/js.translator/testData/box/native/exception.kt
T
2021-11-12 18:44:47 +03:00

14 lines
414 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: UNSUPPORTED_JS_INTEROP
// EXPECTED_REACHABLE_NODES: 1281
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"
}
}