summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/uncaughtExceptionHook-resumption-02.js
blob: a7ffeaf8f57995776d7f0dc8adb1edcd90817254 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// uncaughtExceptionHook resumption value other than undefined causes further
// hooks to be skipped.

var g = newGlobal();
var log;

function makeDebug(g, name) {
    var dbg = new Debugger(g);
    dbg.onDebuggerStatement = function (frame) {
        log += name;
        throw new Error(name);
    };
    dbg.uncaughtExceptionHook = function (exc) {
        assertEq(exc.message, name);
        return name == "2" ? {return: 42} : undefined;
    };
}

var arr = [];
for (var i = 0; i < 6; i++)
    arr[i] = makeDebug(g, "" + i);

log = '';
assertEq(g.eval("debugger;"), 42);
assertEq(log, "012");