michael@0: // frame.live is false for frames removed after their compartments stopped being debuggees. michael@0: michael@0: var g1 = newGlobal(); michael@0: var g2 = newGlobal(); michael@0: var dbg = Debugger(g1, g2); michael@0: var hits = 0; michael@0: var snapshot = []; michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: if (hits++ === 0) { michael@0: assertEq(frame.eval("x();"), null); michael@0: } else { michael@0: for (var f = frame; f; f = f.older) { michael@0: if (f.type === "call" && f.script !== null) michael@0: snapshot.push(f); michael@0: } michael@0: dbg.removeDebuggee(g2); michael@0: return null; michael@0: } michael@0: }; michael@0: michael@0: g1.eval("function z() { debugger; }"); michael@0: g2.z = g1.z; michael@0: g2.eval("function y() { z(); }"); michael@0: g2.eval("function x() { y(); }"); michael@0: assertEq(g2.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);