michael@0: // Test that on-stack Debugger.Frames are not GC'd even if they are only reachable michael@0: // from the js::Debugger::frames table. michael@0: michael@0: var g = newGlobal(); michael@0: g.eval("function f(n) { if (n) f(n - 1); debugger; }"); michael@0: var dbg = new Debugger(g); michael@0: var hits = 0; michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: if (hits === 0) { michael@0: for (; frame; frame = frame.older) michael@0: frame.seen = true; michael@0: } else { michael@0: for (; frame; frame = frame.older) michael@0: assertEq(frame.seen, true); michael@0: } michael@0: gc(); michael@0: hits++; michael@0: }; michael@0: g.f(20); michael@0: assertEq(hits, 21);