js/src/jit-test/tests/debug/Debugger-multi-03.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 // Q: But who shall debug the debuggers?  A: jimb
     3 var log = '';
     5 function addDebug(g, id) {
     6     var debuggerGlobal = newGlobal();
     7     debuggerGlobal.debuggee = g;
     8     debuggerGlobal.id = id;
     9     debuggerGlobal.print = function (s) { log += s; };
    10     debuggerGlobal.eval(
    11         'var dbg = new Debugger(debuggee);\n' +
    12         'dbg.onDebuggerStatement = function () { print(id); debugger; print(id); };\n');
    13     return debuggerGlobal;
    14 }
    16 var base = newGlobal();
    17 var top = base;
    18 for (var i = 0; i < 8; i++)  // why have 2 debuggers when you can have 8
    19     top = addDebug(top, i);
    20 base.eval("debugger;");
    21 assertEq(log, '0123456776543210');

mercurial