js/src/jit-test/tests/debug/resumption-07.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 // Return resumption values to non-debuggee frames.
     3 load(libdir + 'asserts.js');
     5 var g = newGlobal();
     6 var dbg = new Debugger;
     8 var log;
    10 function handlerWithResumption(resumption) {
    11   return function (frame) {
    12     log += 'd';
    13     dbg.removeDebuggee(g);
    14     return resumption;
    15   };
    16 }
    18 log = '';
    19 dbg.onDebuggerStatement = handlerWithResumption(undefined);
    20 dbg.addDebuggee(g);
    21 assertEq(g.eval('debugger; 42;'), 42);
    22 assertEq(log, 'd');
    24 log = '';
    25 dbg.onDebuggerStatement = handlerWithResumption({ return: 1729 });
    26 dbg.addDebuggee(g);
    27 assertEq(g.eval('debugger; 42;'), 1729);
    28 assertEq(log, 'd');
    30 log = '';
    31 dbg.onDebuggerStatement = handlerWithResumption(null);
    32 dbg.addDebuggee(g);
    33 assertEq(g.evaluate('debugger; 42;', { catchTermination: true }), 'terminated');
    34 assertEq(log, 'd');

mercurial