js/src/jit-test/tests/debug/Debugger-debuggees-06.js

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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