js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-08.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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, '((()))');

mercurial