js/src/jit-test/tests/debug/Debugger-debuggees-11.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 // |jit-test| debug
     2 // Don't allow cycles in the graph of the compartment "debugs" relation.
     4 load(libdir + "asserts.js");
     6 // trivial cycles
     7 var dbg = new Debugger;
     8 assertThrowsInstanceOf(function () { dbg.addDebuggee(this); }, TypeError);
     9 assertThrowsInstanceOf(function () { new Debugger(this); }, TypeError);
    11 // cycles of length 2
    12 var d1 = newGlobal();
    13 d1.top = this;
    14 d1.eval("var dbg = new Debugger(top)");
    15 assertThrowsInstanceOf(function () { dbg.addDebuggee(d1); }, TypeError);
    16 assertThrowsInstanceOf(function () { new Debugger(d1); }, TypeError);
    18 // cycles of length 3
    19 var d2 = newGlobal();
    20 d2.top = this;
    21 d2.eval("var dbg = new Debugger(top.d1)");
    22 assertThrowsInstanceOf(function () { dbg.addDebuggee(d2); }, TypeError);
    23 assertThrowsInstanceOf(function () { new Debugger(d2); }, TypeError);

mercurial