summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-live-04.js
blob: c4c9a4d0616c408d39161fabc99ef2e8efe315a5 (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
// frame.live is false for frames discarded during uncatchable error unwinding.

var g = newGlobal();
var dbg = Debugger(g);
var hits = 0;
var snapshot;
dbg.onDebuggerStatement = function (frame) {
    var stack = [];
    for (var f = frame; f; f = f.older) {
        if (f.type === "call" && f.script !== null)
            stack.push(f);
    }
    snapshot = stack;
    if (hits++ === 0)
        assertEq(frame.eval("x();"), null);
    else
        return null;
};

g.eval("function z() { debugger; }");
g.eval("function y() { z(); }");
g.eval("function x() { y(); }");
assertEq(g.eval("debugger; 'ok';"), "ok");
assertEq(hits, 2);
assertEq(snapshot.length, 3);
for (var i = 0; i < snapshot.length; i++)
    assertEq(snapshot[i].live, false);