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 // The property assignments in Array.prototype.sort are strict assignments.
3 load(libdir + "asserts.js");
5 var a = ["A", , "B", "C", "D"];
6 var normalArrayElementDesc = Object.getOwnPropertyDescriptor(a, 0);
7 var getterDesc = {
8 configurable: false,
9 enumerable: true,
10 get: function () { return "F"; },
11 set: undefined
12 };
13 Object.defineProperty(a, 1, getterDesc);
15 // a.sort is permitted to try to delete a[1] or to try to assign a[1], but it
16 // must try one or the other. Either one will fail, throwing a TypeError.
17 assertThrowsInstanceOf(() => a.sort(), TypeError);
19 // a.sort() is not permitted to delete the nonconfigurable property.
20 assertDeepEq(Object.getOwnPropertyDescriptor(a, 1), getterDesc);
22 // The values left in the other elements of a are unspecified; some or all may
23 // have been deleted.
24 for (var i = 0; i < a.length; i++) {
25 if (i !== 1 && a.hasOwnProperty(i)) {
26 normalArrayElementDesc.value = a[i];
27 assertDeepEq(Object.getOwnPropertyDescriptor(a, i), normalArrayElementDesc);
28 }
29 }