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 var g = true;
3 function getown(name)
4 {
5 if (g)
6 return { value: 8, enumerable: true, writable: false, configurable: true };
7 }
9 var p = Proxy.create( { getPropertyDescriptor: getown } );
10 var o2 = Object.create(p);
12 function test(x, expected) {
13 for (var i=0; i<3; i++) {
14 var v = x.hello;
15 if (g) assertEq(v, 8);
16 }
17 }
19 g = false
20 test(o2);
21 g = true;
22 test(o2);