js/src/jit-test/tests/debug/Debugger-multi-01.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 // When there are multiple debuggers, their hooks are called in order.
     3 var g = newGlobal();
     4 var log;
     5 var arr = [];
     7 function addDebug(msg) {
     8     var dbg = new Debugger(g);
     9     dbg.onDebuggerStatement = function (stack) { log += msg; };
    10     arr.push(dbg);
    11 }
    13 addDebug('a');
    14 addDebug('b');
    15 addDebug('c');
    17 log = '';
    18 assertEq(g.eval("debugger; 0;"), 0);
    19 assertEq(log, 'abc');
    21 // Calling debugger hooks stops as soon as any hook returns a resumption value
    22 // other than undefined.
    24 arr[0].onDebuggerStatement = function (stack) {
    25     log += 'a';
    26     return {return: 1};
    27 };
    29 log = '';
    30 assertEq(g.eval("debugger; 0;"), 1);
    31 assertEq(log, 'a');

mercurial