michael@0: // getChildScripts on a direct eval script returns the right scripts. michael@0: // (A bug had it also returning the script for the calling function.) michael@0: michael@0: var g = newGlobal(); michael@0: var dbg = Debugger(g); michael@0: var hits = 0; michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: var arr = frame.script.getChildScripts(); michael@0: assertEq(arr.length, 1); michael@0: assertEq(arr[0], frame.eval("h").return.script); michael@0: hits++; michael@0: }; michael@0: michael@0: g.eval("function f(s) { eval(s); }"); michael@0: g.f("debugger; function h(a) { return a + 1; }"); michael@0: assertEq(hits, 1);