summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/uncaughtExceptionHook-01.js
blob: 2303e2339f2d1404941ec4eb0bd81f8c94e94603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Uncaught exceptions in the debugger itself are delivered to the
// uncaughtExceptionHook.

var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);
var log;
dbg.onDebuggerStatement = function () {
    log += 'x';
    throw new TypeError("fail");
};
dbg.uncaughtExceptionHook = function (exc) {
    assertEq(this, dbg);
    assertEq(exc instanceof TypeError, true);
    log += '!';
};

log = '';
g.eval("debugger");
assertEq(log, 'x!');