michael@0: // frame.live is false for frames discarded during uncatchable error unwinding. michael@0: michael@0: var g = newGlobal(); michael@0: var dbg = Debugger(g); michael@0: var hits = 0; michael@0: var snapshot; michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: var stack = []; michael@0: for (var f = frame; f; f = f.older) { michael@0: if (f.type === "call" && f.script !== null) michael@0: stack.push(f); michael@0: } michael@0: snapshot = stack; michael@0: if (hits++ === 0) michael@0: assertEq(frame.eval("x();"), null); michael@0: else michael@0: return null; michael@0: }; michael@0: michael@0: g.eval("function z() { debugger; }"); michael@0: g.eval("function y() { z(); }"); michael@0: g.eval("function x() { y(); }"); michael@0: assertEq(g.eval("debugger; 'ok';"), "ok"); michael@0: assertEq(hits, 2); michael@0: assertEq(snapshot.length, 3); michael@0: for (var i = 0; i < snapshot.length; i++) michael@0: assertEq(snapshot[i].live, false);