summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-arguments-04.js
blob: c8d13afeeed5ab12f0a73d838d73609b9844d2be (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();
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);