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 function f(arr, i, v)
2 {
3 arr[i] = v;
4 }
6 function test()
7 {
8 // Use a much-greater capacity than the eventual non-writable length.
9 var a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
10 Object.defineProperty(a, "length", { writable: false, value: 6 });
12 for (var i = 0; i < 100; i++)
13 f(a, a.length, i);
15 assertEq(a.hasOwnProperty(6), false);
16 assertEq(a[6], undefined);
17 assertEq(a.length, 6);
18 }
20 test();