summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-onStep-resumption-03.js
blob: ab3ecdd85508a09c2a3f4afc8bcfa8310ae248c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// If frame.onStep returns null, the debuggee terminates.

var g = newGlobal({newCompartment: true});
g.eval("function h() { debugger; }");

var dbg = Debugger(g);
var hits = 0;
dbg.onDebuggerStatement = function (frame) {
    hits++;
    if (hits == 1) {
        var rv = frame.eval("h();\n" +
                            "throw 'fail';\n");
        assertEq(rv, null);
    } else {
        frame.older.onStep = function () { return null; };
    }
};
g.h();
assertEq(hits, 2);