summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-onStep-resumption-03.js
blob: d2ee163ee3e7cf538322a6d570af69554d062aa1 (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();
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);