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 load(libdir + "asserts.js");
3 /*
4 * Throw a TypeError if the enumerable fields of the current descriptor and the
5 * descriptor returned by the trap are the boolean negation of each other
6 */
7 var target = {};
8 Object.defineProperty(target, 'foo', {
9 configurable: false,
10 enumerable: true
11 });
12 var caught = false;
13 assertThrowsInstanceOf(function () {
14 Object.getOwnPropertyDescriptor(new Proxy(target, {
15 getOwnPropertyDescriptor: function (target, name) {
16 return {
17 configurable: false,
18 enumerable: false
19 };
20 }
21 }), 'foo');
22 }, TypeError);
24 var target = {};
25 Object.defineProperty(target, 'foo', {
26 configurable: false,
27 enumerable: false
28 });
29 var caught = false;
30 assertThrowsInstanceOf(function () {
31 Object.getOwnPropertyDescriptor(new Proxy(target, {
32 getOwnPropertyDescriptor: function (target, name) {
33 return {
34 configurable: false,
35 enumerable: true
36 };
37 }
38 }), 'foo');
39 }, TypeError);