michael@0: // Creating a global within an onNewGlobalObject handler causes a recursive handler invocation. michael@0: // michael@0: // This isn't really desirable behavior, as presumably a global created while a michael@0: // handler is running is one the debugger is creating for its own purposes and michael@0: // should not be observed, but if this behavior changes, we sure want to know. michael@0: michael@0: var dbg = new Debugger; michael@0: var log; michael@0: var depth; michael@0: michael@0: dbg.onNewGlobalObject = function (global) { michael@0: log += '('; depth++; michael@0: michael@0: assertEq(global.seen, undefined); michael@0: global.seen = true; michael@0: michael@0: if (depth < 3) michael@0: newGlobal(); michael@0: michael@0: log += ')'; depth--; michael@0: }; michael@0: michael@0: log = ''; michael@0: depth = 0; michael@0: newGlobal(); michael@0: assertEq(log, '((()))');