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 + "eqArrayHelper.js");
3 // ParallelArray surfaces
5 function test() {
6 var desc = Object.getOwnPropertyDescriptor(this, "ParallelArray");
7 assertEq(desc.enumerable, false);
8 assertEq(desc.configurable, true);
9 assertEq(desc.writable, true);
11 assertEq(typeof ParallelArray, 'function');
12 assertEq(Object.keys(ParallelArray).length, 0);
13 assertEq(ParallelArray.length, 0);
14 assertEq(ParallelArray.name, "ParallelArray");
16 assertEq(Object.getPrototypeOf(ParallelArray.prototype), Object.prototype);
17 assertEq(Object.prototype.toString.call(ParallelArray.prototype), "[object ParallelArray]");
18 assertEq(Object.prototype.toString.call(new ParallelArray), "[object ParallelArray]");
19 assertEq(Object.prototype.toString.call(ParallelArray()), "[object ParallelArray]");
20 assertEq(Object.keys(ParallelArray.prototype).join(), "");
21 assertEq(ParallelArray.prototype.constructor, ParallelArray);
23 function checkMethod(name, arity) {
24 var desc = Object.getOwnPropertyDescriptor(ParallelArray.prototype, name);
25 assertEq(desc.enumerable, false);
26 assertEq(desc.configurable, true);
27 assertEq(desc.writable, true);
28 assertEq(typeof desc.value, 'function');
29 assertEq(desc.value.name, name);
30 assertEq(desc.value.length, arity);
31 }
33 checkMethod("map", 1);
34 checkMethod("reduce", 1);
35 checkMethod("scan", 1);
36 checkMethod("scatter", 1);
37 checkMethod("filter", 1);
38 checkMethod("flatten", 0);
39 checkMethod("partition", 1);
40 checkMethod("get", 1);
42 function checkAccessor(name) {
43 var desc = Object.getOwnPropertyDescriptor(ParallelArray.prototype, name);
44 assertEq(desc.enumerable, false);
45 assertEq(desc.configurable, false);
46 assertEq(typeof desc.get, 'function');
47 assertEq(desc.set, undefined);
48 }
50 checkAccessor("length");
51 checkAccessor("shape");
52 }
54 // FIXME(bug 844882) self-hosted object not array-like, exposes internal properties
55 // if (getBuildConfiguration().parallelJS) test();