michael@0: // Bug 717104 - Unreachable debuggee globals should not keep their debuggers michael@0: // alive. The loop is to defeat conservative stack scanning; if the same stack michael@0: // locations are used each time through the loop, at least three of the michael@0: // debuggers should be collected. michael@0: // michael@0: // This is a slight modification of gc-09.js, which contains a cycle. michael@0: michael@0: for (var i = 0; i < 4; i++) { michael@0: var g = newGlobal(); michael@0: var dbg = new Debugger(g); michael@0: dbg.onDebuggerStatement = function () { throw "FAIL"; }; michael@0: dbg.o = makeFinalizeObserver(); michael@0: } michael@0: michael@0: gc(); michael@0: assertEq(finalizeCount() > 0, true);