michael@0: // A garbage collection in the debugger compartment does not disturb onPop michael@0: // handlers. michael@0: var g = newGlobal(); michael@0: var dbg = new Debugger(g); michael@0: var log; michael@0: michael@0: dbg.onEnterFrame = function handleEnter(frame) { michael@0: log += '('; michael@0: frame.onPop = function handlePop(completion) { michael@0: log += ')'; michael@0: }; michael@0: }; michael@0: michael@0: dbg.onDebuggerStatement = function handleDebugger (frame) { michael@0: log += 'd'; michael@0: // GC in the debugger's compartment only. michael@0: gc(dbg); michael@0: }; michael@0: michael@0: log = ''; michael@0: assertEq(g.eval('debugger; 42;'), 42); michael@0: assertEq(log, '(d)');