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

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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