summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onExceptionUnwind-08.js
blob: de804c5e3f3c293c1b6087aea91980334a222885 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Ensure that uncaught exceptions thrown in onExceptionUnwind do not
// propagate outward into debuggee execution.
var g = newGlobal({newCompartment: true});
var dbg = Debugger(g);
var frame;
dbg.onExceptionUnwind = function (f, x) {
    frame = f;
    assertEq(frame.onStack, true);
    throw 'unhandled';
};
dbg.onDebuggerStatement = function(f) {
    assertEq(f.eval('throw 42').throw, 42);
    assertEq(frame.onStack, false);
};
g.eval('debugger');

// Don't fail just because we reported an uncaught exception.
quit(0);