diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/baseline/bug836742.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/baseline/bug836742.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,34 @@ +// |jit-test| debug +// Ensure the correct frame is passed to exception unwind hooks. +var g = newGlobal(); +g.debuggeeGlobal = this; +g.eval("(" + function () { + frames = []; + var dbg = Debugger(debuggeeGlobal); + dbg.onEnterFrame = function(frame) { + frames.push(frame); + }; + dbg.onExceptionUnwind = function(frame) { + assertEq(frames.indexOf(frame), frames.length - 1); + frames.pop(); + assertEq(frame, dbg.getNewestFrame()); + } +} + ")()"); + +function f(n) { + debugger; + n--; + if (n > 0) { + f(n); + } else { + assertEq(g.frames.length, 10); + throw "fit"; + } +} +try { + f(10); + assertEq(0, 1); +} catch (e) { + assertEq(e, "fit"); +} +assertEq(g.frames.length, 0);