summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onExceptionUnwind-04.js
blob: 678d0bf4bb085594c9d66fdb1a13963acea2c2eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// onExceptionUnwind is not called for exceptions thrown and handled in the debugger.
var g = newGlobal({newCompartment: true});
var dbg = Debugger(g);
g.log = '';
dbg.onDebuggerStatement = function (frame) {
    try {
        throw new Error("oops");
    } catch (exc) {
        g.log += exc.message;
    }
};
dbg.onExceptionUnwind = function (frame) {
    g.log += 'BAD';
};

g.eval("debugger; log += ' ok';");
assertEq(g.log, 'oops ok');