summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/regress/no-directives/debugger-no-script.js
blob: 1072e9268ebe1355bbbd8686f10cf8a6b13f987a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// |jit-test| skip-if: !wasmDebuggingEnabled(); exitstatus:3

function userError() {};

let g = newGlobal({newCompartment: true});
let dbg = new Debugger(g);

g.eval(`
  var wasm = wasmTextToBinary('(module (func (export "test") (nop)))');
  var m = new WebAssembly.Instance(new WebAssembly.Module(wasm));
`);

dbg.onEnterFrame = function(frame) {
    if (frame.type == "wasmcall") {
        throw new userError()
    }
}

result = g.eval("m.exports.test()");