Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
1 // Return the descriptor returned by the trap
2 var target = {};
3 Object.defineProperty(target, 'foo', {
4 value: 'bar',
5 writable: true,
6 enumerable: false,
7 configurable: true
8 });
9 var desc = {
10 value: 'baz',
11 writable: false,
12 enumerable: true,
13 configurable: true
14 };
15 var desc1 = Object.getOwnPropertyDescriptor(new Proxy(target, {
16 getOwnPropertyDescriptor: function (target, name) {
17 return desc;
18 }
19 }), 'foo');
20 assertEq(desc1 == desc, false);
21 assertEq(desc1.value, 'baz');
22 assertEq(desc1.writable, false);
23 assertEq(desc1.enumerable, true);
24 assertEq(desc1.configurable, true);
26 var desc = {};
27 var desc1 = Object.getOwnPropertyDescriptor(new Proxy(target, {
28 getOwnPropertyDescriptor: function (target, name) {
29 return desc;
30 }
31 }), 'foo');
32 assertEq(desc1 == desc, false);
33 assertEq(desc1.value, undefined);
34 assertEq(desc1.writable, false);
35 assertEq(desc1.enumerable, false);
36 assertEq(desc1.configurable, false);