summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/regress/debug-exception-in-fast-import.js
blob: bba37b38b005637445dc638ea46d7a912e71e0d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// |jit-test| skip-if: !wasmDebuggingEnabled()
g = newGlobal({newCompartment: true});
g.parent = this;
g.eval("(" + function() {
    Debugger(parent).onExceptionUnwind = function(frame) {}
} + ")()")

o = {};

let { exports } = wasmEvalText(`
  (module (import "" "inc" (func $imp)) (func) (func $start (call $imp)) (start $start) (export "" (func $start)))
`, {
    "": {
        inc: function() { o = o.p; }
    }
});

// after instanciation, the start function has been executed and o is undefined.
// This second call will throw in the imported function:

assertErrorMessage(exports[""], TypeError, /undefined/);