michael@0: // |jit-test| debug michael@0: // Frame.prototype.script for call 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, "call"); michael@0: f(frame.script); michael@0: }; michael@0: g.eval(code); michael@0: } michael@0: michael@0: ApplyToFrameScript('(function () { debugger; })();', 0, michael@0: function (script) { michael@0: assertEq(script instanceof Debugger.Script, true); michael@0: }); michael@0: michael@0: // This would be nice, once we can get host call frames: michael@0: // ApplyToFrameScript("(function () { debugger; }).call(null);", 1, michael@0: // function (script) { michael@0: // assertEq(script, null); michael@0: // });