blob: 75fcfb52f373fe3cf28264fd740699482b115976 [file]
// TARGET_BACKEND: WASM
// ^^ KT-83093
// FILE: main.kt
fun throwNumberFromJs(): Int = js("{ throw 42; }")
fun main() {
throwNumberFromJs()
}
fun box() = "OK"
// FILE: entry.mjs
let nothrow = false;
try {
const m = await import("./index.mjs")
nothrow = true
} catch(e) {
if (typeof e !== "number") {
throw Error("Expected number")
}
if (e !== 42) {
throw Error("Wrong value")
}
}
if (nothrow) throw Error("Unexpected successful call");