michael@0: // Setting an onPop handler from an onPop handler doesn't throw, but the michael@0: // new handler doesn't fire. michael@0: var g = newGlobal(); michael@0: var dbg = new Debugger(g); michael@0: var log; michael@0: michael@0: dbg.onDebuggerStatement = function handleDebugger(frame) { michael@0: log += 'd'; michael@0: assertEq(frame.type, "eval"); michael@0: frame.onPop = function firstHandlePop(c) { michael@0: log +=')'; michael@0: assertEq(c.return, 'on investment'); michael@0: this.onPop = function secondHandlePop(c) { michael@0: assertEq("secondHandlePop was called", "secondHandlePop should never be called"); michael@0: }; michael@0: }; michael@0: }; michael@0: michael@0: log = ""; michael@0: g.eval("debugger; 'on investment';"); michael@0: assertEq(log, 'd)');