summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-older-01.js
blob: 1a21d1b448a914092d16e69b90f8f0f863e72e80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Basic call chain.

var g = newGlobal();
var result = null;
var dbg = new Debugger(g);
dbg.onDebuggerStatement = function (frame) {
    var a = [];
    assertEq(frame === frame.older, false);
    for (; frame; frame = frame.older)
        a.push(frame.type === 'call' ? frame.callee.name : frame.type);
    a.reverse();
    result = a.join(", ");
};

g.eval("function first() { return second(); }");
g.eval("function second() { return eval('third()'); }");
g.eval("function third() { debugger; }");
g.evaluate("first();");
assertEq(result, "global, first, second, eval, third");