js/src/jit-test/tests/debug/Debugger-debuggees-17.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 // addDebuggee, hasDebuggee, and removeDebuggee all throw if presented with
     2 // objects that are not valid global object designators.
     4 load(libdir + 'asserts.js');
     6 var dbg = new Debugger;
     8 function check(bad) {
     9   print("check(" + uneval(bad) + ")");
    10   assertThrowsInstanceOf(function () { dbg.addDebuggee(bad); }, TypeError);
    11   assertEq(dbg.getDebuggees().length, 0);
    12   assertThrowsInstanceOf(function () { dbg.hasDebuggee(bad); }, TypeError);
    13   assertThrowsInstanceOf(function () { dbg.removeDebuggee(bad); }, TypeError);
    14 }
    16 var g = newGlobal();
    17 check(g.Object());
    18 check(g.Object);
    19 check(g.Function(""));
    21 // A Debugger.Object belonging to a different Debugger is not a valid way
    22 // to designate a global, even if its referent is a global.
    23 var g2 = newGlobal();
    24 var dbg2 = new Debugger;
    25 var d2g2 = dbg2.addDebuggee(g2);
    26 check(d2g2);

mercurial