blob: 5b6bbb21e42b5e637066a69afed9a8deb3b82e2a (
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();
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(".)"));
|