michael@0: // |jit-test| debug michael@0: // Ensure the correct frame is passed to exception unwind hooks. michael@0: var g = newGlobal(); michael@0: g.debuggeeGlobal = this; michael@0: g.eval("(" + function () { michael@0: frames = []; michael@0: var dbg = Debugger(debuggeeGlobal); michael@0: dbg.onEnterFrame = function(frame) { michael@0: frames.push(frame); michael@0: }; michael@0: dbg.onExceptionUnwind = function(frame) { michael@0: assertEq(frames.indexOf(frame), frames.length - 1); michael@0: frames.pop(); michael@0: assertEq(frame, dbg.getNewestFrame()); michael@0: } michael@0: } + ")()"); michael@0: michael@0: function f(n) { michael@0: debugger; michael@0: n--; michael@0: if (n > 0) { michael@0: f(n); michael@0: } else { michael@0: assertEq(g.frames.length, 10); michael@0: throw "fit"; michael@0: } michael@0: } michael@0: try { michael@0: f(10); michael@0: assertEq(0, 1); michael@0: } catch (e) { michael@0: assertEq(e, "fit"); michael@0: } michael@0: assertEq(g.frames.length, 0);