diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/debug/Object-apply-03.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/debug/Object-apply-03.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,21 @@ +// reentering the debugger several times via onDebuggerStatement and apply/call on a single stack + +var g = newGlobal(); +var dbg = Debugger(g); + +function test(usingApply) { + dbg.onDebuggerStatement = function (frame) { + var n = frame.arguments[0]; + if (n > 1) { + var result = usingApply ? frame.callee.apply(null, [n - 1]) + : frame.callee.call(null, n - 1); + result.return *= n; + return result; + } + }; + g.eval("function fac(n) { debugger; return 1; }"); + assertEq(g.fac(5), 5 * 4 * 3 * 2 * 1); +} + +test(true); +test(false);