1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/Script-getLineOffsets-07.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,19 @@ 1.4 +// Lazy scripts should correctly report line offsets 1.5 + 1.6 +var g = newGlobal(); 1.7 +var dbg = new Debugger(); 1.8 + 1.9 +g.eval("// Header comment\n" + // <- line 6 in this file 1.10 + "\n" + 1.11 + "\n" + 1.12 + "function f(n) {\n" + // <- line 9 in this file 1.13 + " var foo = '!';\n" + 1.14 + "}"); 1.15 + 1.16 +dbg.addDebuggee(g); 1.17 +var scripts = dbg.findScripts(); 1.18 +for (var i = 0; i < scripts.length; i++) { 1.19 + // Nothing should have offsets for the deffun on line 9 if lazy scripts 1.20 + // correctly update the position. 1.21 + assertEq(scripts[i].getLineOffsets(9).length, 0); 1.22 +}