michael@0: // frame.eval can evaluate code in a frame pushed in another context. Bug 749697. michael@0: michael@0: // In other words, the debugger can see all frames on the stack, even though michael@0: // each frame is attached to a particular JSContext and multiple JSContexts may michael@0: // have frames on the stack. michael@0: michael@0: var g = newGlobal(); michael@0: g.eval('function f(a) { debugger; evaluate("debugger;", {newContext: true}); }'); michael@0: michael@0: var dbg = new Debugger(g); michael@0: var hits = 0; michael@0: dbg.onDebuggerStatement = function (frame1) { michael@0: dbg.onDebuggerStatement = function (frame2) { michael@0: assertEq(frame1.eval("a").return, 31); michael@0: hits++; michael@0: }; michael@0: }; michael@0: michael@0: g.f(31); michael@0: assertEq(hits, 1);