summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-offset-02.js
blob: 344a11bfc5a82f59466bd9cccd24d944afb8d45a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// frame.offset gives different values at different points in a script.

var g = newGlobal();
var dbg = Debugger(g);
var s = undefined, a = []
dbg.onDebuggerStatement = function (frame) {
    if (s === undefined)
        s = frame.script;
    else
        assertEq(s, frame.script);
    assertEq(frame.offset !== undefined, true);
    assertEq(a.indexOf(frame.offset), -1);
    a.push(frame.offset);
};
g.eval("debugger; debugger; debugger;");
assertEq(a.length, 3);