js/src/jit-test/tests/debug/Debugger-onNewGlobalObject-12.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 // Resumption values from uncaughtExceptionHook from onNewGlobalObject
     2 // handlers affect the dispatch of the event to other Debugger instances.
     4 load(libdir + 'asserts.js');
     6 var dbg1 = new Debugger;
     7 var dbg2 = new Debugger;
     8 var dbg3 = new Debugger;
     9 var log;
    10 var count;
    12 dbg1.onNewGlobalObject = dbg2.onNewGlobalObject = dbg3.onNewGlobalObject = function () {
    13   log += 'n';
    14   throw 'party';
    15 };
    17 dbg1.uncaughtExceptionHook = dbg2.uncaughtExceptionHook = dbg3.uncaughtExceptionHook =
    18 function (ex) {
    19   log += 'u';
    20   assertEq(ex, 'party');
    21   if (++count == 2)
    22     return { throw: 'fit' };
    23   return undefined;
    24 };
    26 log = '';
    27 count = 0;
    28 assertEq(typeof newGlobal(), 'object');
    29 assertEq(log, 'nunu');

mercurial