js/src/jit-test/tests/debug/Script-getOffsetLine-02.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:9ac6ad0ec9cf
1 // Frame.script/offset and Script.getOffsetLine work in non-top frames.
2
3 var g = newGlobal();
4 var dbg = Debugger(g);
5 var hits = 0;
6 dbg.onDebuggerStatement = function (frame) {
7 var a = [];
8 for (; frame.type == "call"; frame = frame.older)
9 a.push(frame.script.getOffsetLine(frame.offset) - g.line0);
10 assertEq(a.join(","), "1,2,3,4");
11 hits++;
12 };
13 g.eval("var line0 = Error().lineNumber;\n" +
14 "function f0() { debugger; }\n" +
15 "function f1() { f0(); }\n" +
16 "function f2() { f1(); }\n" +
17 "function f3() { f2(); }\n" +
18 "f3();\n");
19 assertEq(hits, 1);

mercurial