Thu, 15 Jan 2015 15:59:08 +0100
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 // Debugger.prototype.findAllGlobals surface.
3 load(libdir + 'asserts.js');
5 var dbg = new Debugger;
6 var d = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(dbg), 'findAllGlobals');
7 assertEq(d.configurable, true);
8 assertEq(d.enumerable, false);
9 assertEq(d.writable, true);
10 assertEq(typeof d.value, 'function');
11 assertEq(dbg.findAllGlobals.length, 0);
12 assertEq(dbg.findAllGlobals.name, 'findAllGlobals');
14 // findAllGlobals can only be applied to real Debugger instances.
15 assertThrowsInstanceOf(function() {
16 Debugger.prototype.findAllGlobals.call(Debugger.prototype);
17 },
18 TypeError);
19 var a = dbg.findAllGlobals();
20 assertEq(a instanceof Array, true);
21 assertEq(a.length > 0, true);
22 for (g of a) {
23 assertEq(g instanceof Debugger.Object, true);
24 }