diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/debug/cross-context-1.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/debug/cross-context-1.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,20 @@ +// frame.eval can evaluate code in a frame pushed in another context. Bug 749697. + +// In other words, the debugger can see all frames on the stack, even though +// each frame is attached to a particular JSContext and multiple JSContexts may +// have frames on the stack. + +var g = newGlobal(); +g.eval('function f(a) { debugger; evaluate("debugger;", {newContext: true}); }'); + +var dbg = new Debugger(g); +var hits = 0; +dbg.onDebuggerStatement = function (frame1) { + dbg.onDebuggerStatement = function (frame2) { + assertEq(frame1.eval("a").return, 31); + hits++; + }; +}; + +g.f(31); +assertEq(hits, 1);