michael@0: // |jit-test| debug michael@0: // Frame.prototype.script for eval frames. michael@0: michael@0: var g = newGlobal(); michael@0: var dbg = new Debugger(g); michael@0: michael@0: // Apply |f| to each frame that is |skip| frames up from each frame that michael@0: // executes a 'debugger' statement when evaluating |code| in the global g. michael@0: function ApplyToFrameScript(code, skip, f) { michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: while (skip-- > 0) michael@0: frame = frame.older; michael@0: assertEq(frame.type, "eval"); michael@0: f(frame.script); michael@0: }; michael@0: g.eval(code); michael@0: } michael@0: michael@0: ApplyToFrameScript('debugger;', 0, michael@0: function (script) { michael@0: assertEq(script instanceof Debugger.Script, true); michael@0: }); michael@0: ApplyToFrameScript("(function () { eval('debugger;'); })();", 0, michael@0: function (script) { michael@0: assertEq(script instanceof Debugger.Script, true); michael@0: });