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 // Map methods throw when passed a this-value that isn't a Map.
3 load(libdir + "asserts.js");
5 function testcase(obj, fn) {
6 assertEq(typeof fn, "function");
7 var args = Array.slice(arguments, 2);
8 assertThrowsInstanceOf(function () { fn.apply(obj, args); }, TypeError);
9 }
11 var Map_size_getter = Object.getOwnPropertyDescriptor(Map.prototype, "size").get;
13 function test(obj) {
14 testcase(obj, Map.prototype.get, "x");
15 testcase(obj, Map.prototype.has, "x");
16 testcase(obj, Map.prototype.set, "x", 1);
17 testcase(obj, Map.prototype.delete, "x");
18 testcase(obj, Map.prototype.clear);
19 testcase(obj, Map.prototype.keys);
20 testcase(obj, Map.prototype.values);
21 testcase(obj, Map.prototype.entries);
22 testcase(obj, Map_size_getter);
23 }
25 test(Map.prototype);
26 test(Object.create(new Map));
27 test(new Set());
28 test({});
29 test(null);
30 test(undefined);