js/src/jit-test/tests/debug/Source-introductionScript-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 // We don't record introduction scripts in a different global from the
     2 // introduced script, even if they're both debuggees.
     4 var dbg = new Debugger;
     6 var g1 = newGlobal();
     7 g1.g1 = g1;
     8 var g1DO = dbg.addDebuggee(g1);
    10 var g2 = newGlobal();
    11 g2.g1 = g1;
    13 var log = '';
    14 dbg.onDebuggerStatement = function (frame) {
    15   log += 'd';
    16   assertEq(frame.script.source.introductionScript, undefined);
    17   assertEq(frame.script.source.introductionOffset, undefined);
    18 };
    20 g2.eval('g1.eval("debugger;");');
    21 assertEq(log, 'd');
    23 // Just for sanity: when it's not cross-global, we do note the introducer.
    24 log = '';
    25 dbg.onDebuggerStatement = function (frame) {
    26   log += 'd';
    27   assertEq(frame.script.source.introductionScript instanceof Debugger.Script, true);
    28   assertEq(typeof frame.script.source.introductionOffset, "number");
    29 };
    30 // Exactly as above, but with g1 instead of g2.
    31 g1.eval('g1.eval("debugger;");');
    32 assertEq(log, 'd');

mercurial