Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // Creating a global within an onNewGlobalObject handler causes a recursive handler invocation.
2 //
3 // This isn't really desirable behavior, as presumably a global created while a
4 // handler is running is one the debugger is creating for its own purposes and
5 // should not be observed, but if this behavior changes, we sure want to know.
7 var dbg = new Debugger;
8 var log;
9 var depth;
11 dbg.onNewGlobalObject = function (global) {
12 log += '('; depth++;
14 assertEq(global.seen, undefined);
15 global.seen = true;
17 if (depth < 3)
18 newGlobal();
20 log += ')'; depth--;
21 };
23 log = '';
24 depth = 0;
25 newGlobal();
26 assertEq(log, '((()))');