michael@0: // Within a series of evals and calls, all their frames' scripts appear in findScripts' result. michael@0: var g = newGlobal(); michael@0: var dbg = new Debugger(g); michael@0: var log; michael@0: michael@0: g.check = function () { michael@0: log += 'c'; michael@0: var scripts = dbg.findScripts(); michael@0: michael@0: var innerEvalFrame = dbg.getNewestFrame(); michael@0: assertEq(innerEvalFrame.type, "eval"); michael@0: assertEq(scripts.indexOf(innerEvalFrame.script) != -1, true); michael@0: michael@0: var callFrame = innerEvalFrame.older; michael@0: assertEq(callFrame.type, "call"); michael@0: assertEq(scripts.indexOf(callFrame.script) != -1, true); michael@0: michael@0: var outerEvalFrame = callFrame.older; michael@0: assertEq(outerEvalFrame.type, "eval"); michael@0: assertEq(scripts.indexOf(outerEvalFrame.script) != -1, true); michael@0: assertEq(innerEvalFrame != outerEvalFrame, true); michael@0: }; michael@0: michael@0: g.eval('function f() { eval("check();") }'); michael@0: log = ''; michael@0: g.eval('f();'); michael@0: assertEq(log, 'c');