1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/Script-getChildScripts-03.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,16 @@ 1.4 +// getChildScripts on a direct eval script returns the right scripts. 1.5 +// (A bug had it also returning the script for the calling function.) 1.6 + 1.7 +var g = newGlobal(); 1.8 +var dbg = Debugger(g); 1.9 +var hits = 0; 1.10 +dbg.onDebuggerStatement = function (frame) { 1.11 + var arr = frame.script.getChildScripts(); 1.12 + assertEq(arr.length, 1); 1.13 + assertEq(arr[0], frame.eval("h").return.script); 1.14 + hits++; 1.15 +}; 1.16 + 1.17 +g.eval("function f(s) { eval(s); }"); 1.18 +g.f("debugger; function h(a) { return a + 1; }"); 1.19 +assertEq(hits, 1);