summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onEnterFrame-03.js
blob: dcb78e971cdf2c8dff2da5b5232a89b49d4b2905 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// frame.eval works in the enterFrame hook.
// It triggers the enterFrame hook again, recursively. (!)

var g = newGlobal({newCompartment: true});
g.a = ".";

var dbg = Debugger(g);
var nestCount = 0, N = 9;
var log = "";
dbg.onEnterFrame = function (frame) {
    assertEq(frame.type, "eval");
    if (nestCount < N) {
        log += '(';
        nestCount++;
        var a = frame.eval("a").return;
        log += a;
        nestCount--;
        log += ')';
    }
};

assertEq(g.eval("a"), ".");
assertEq(log, Array(N + 1).join("(") + Array(N + 1).join(".)"));