summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-arguments-04.js
blob: 21db3560aa69251defc80fe2b46a851220e59210 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// frame.arguments works for all live frames

var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);
var hits = 0;
dbg.onDebuggerStatement = function (frame) {
    for (var i = 0; i <= 4; i++) {
        assertEq(frame.arguments.length, 1);
        assertEq(frame.arguments[0], i);
        frame = frame.older;
    }
    assertEq(frame, null);
    hits++;
};

g.eval("function f(n) { if (n == 0) debugger; else f(n - 1); }");
g.f(4);
assertEq(hits, 1);