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.
michael@0 | 1 | // Check superficial characteristics of functions and properties (not functionality). |
michael@0 | 2 | |
michael@0 | 3 | function checkFunction(obj, name, nargs) { |
michael@0 | 4 | var desc = Object.getOwnPropertyDescriptor(obj, name); |
michael@0 | 5 | assertEq(desc.configurable, true, name + " should be configurable"); |
michael@0 | 6 | assertEq(desc.writable, true, name + " should be writable"); |
michael@0 | 7 | assertEq(desc.enumerable, false, name + " should be non-enumerable"); |
michael@0 | 8 | assertEq(desc.value, obj[name]); // well obviously |
michael@0 | 9 | assertEq(typeof desc.value, 'function', name + " should be a function"); |
michael@0 | 10 | assertEq(desc.value.length, nargs, name + " should have .length === " + nargs); |
michael@0 | 11 | } |
michael@0 | 12 | |
michael@0 | 13 | checkFunction(this, "Debugger", 1); |
michael@0 | 14 | |
michael@0 | 15 | assertEq(Debugger.prototype.constructor, Debugger); |
michael@0 | 16 | assertEq(Object.prototype.toString.call(Debugger.prototype), "[object Debugger]"); |
michael@0 | 17 | assertEq(Object.getPrototypeOf(Debugger.prototype), Object.prototype); |