summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/uncaughtExceptionHook-03.js
blob: d9dc5067644f4a1ee5aa83d2847917a4c4fea071 (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
26
27
28
29
30
31
32
33
34
// |jit-test| error: ReferenceError
// If uncaughtExceptionHook is absent, the debuggee is terminated.

var g = newGlobal();
g.debuggeeGlobal = this;
g.eval("(" + function () {
        var dbg = Debugger(debuggeeGlobal);
        dbg.onDebuggerStatement = function (frame) {
            if (frame.callee === null) {
                debuggeeGlobal.log += '1';
                var cv = frame.eval("f();");
                debuggeeGlobal.log += '2';
                assertEq(cv, null);
            } else {
                assertEq(frame.callee.name, "f");
                debuggeeGlobal.log += '3';
                throw new ReferenceError("oops");
            }
        };
    } + ")();");

function onerror(msg) {
}

var log = '';
debugger;
function f() {
    try {
        debugger;
    } finally {
        log += 'x';
    }
}
assertEq(log, '132');