js/src/jit-test/tests/debug/Debugger-debuggees-06.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 // {has,add,remove}Debuggee throw a TypeError if the argument is invalid.
     3 load(libdir + "asserts.js");
     5 var dbg = new Debugger;
     7 function check(val) {
     8     assertThrowsInstanceOf(function () { dbg.hasDebuggee(val); }, TypeError);
     9     assertThrowsInstanceOf(function () { dbg.addDebuggee(val); }, TypeError);
    10     assertThrowsInstanceOf(function () { dbg.removeDebuggee(val); }, TypeError);
    11 }
    13 // Primitive values are invalid.
    14 check(undefined);
    15 check(null);
    16 check(false);
    17 check(1);
    18 check(NaN);
    19 check("ok");
    21 // A Debugger.Object that belongs to a different Debugger object is invalid.
    22 var g = newGlobal();
    23 var dbg2 = new Debugger;
    24 var w = dbg2.addDebuggee(g);
    25 assertEq(w instanceof Debugger.Object, true);
    26 check(w);

mercurial