summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/resumption-error-02.js
blob: be5bf54b98c20d9e52d7d3c2ab184ada40817ad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Error handling if parsing a resumption value throws.

var g = newGlobal();
var dbg = Debugger(g);
var rv;
dbg.onDebuggerStatement = stack => rv;
dbg.uncaughtExceptionHook = function (exc) {
    assertEq(exc, "BANG");
    return {return: "recovered"};
};

rv = {get throw() { throw "BANG"; }};
assertEq(g.eval("debugger; false;"), "recovered");

rv = new Proxy({}, {has() { throw "BANG"; }});
assertEq(g.eval("debugger; false;"), "recovered");