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 /*
2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/licenses/publicdomain/
4 */
6 var BUGNUMBER = 677820;
7 var summary =
8 "String.prototype.match must define matches on the returned array, not set " +
9 "them";
11 print(BUGNUMBER + ": " + summary);
13 /**************
14 * BEGIN TEST *
15 **************/
17 var called = false;
18 function setterFunction(v) { called = true; }
19 function getterFunction(v) { return "getter"; }
21 Object.defineProperty(Array.prototype, 1,
22 { get: getterFunction, set: setterFunction });
24 assertEq(called, false);
25 var matches = "abcdef".match(/./g);
26 assertEq(called, false);
27 assertEq(matches.length, 6);
28 assertEq(matches[0], "a");
29 assertEq(matches[1], "b");
30 assertEq(matches[2], "c");
31 assertEq(matches[3], "d");
32 assertEq(matches[4], "e");
33 assertEq(matches[5], "f");
35 var desc = Object.getOwnPropertyDescriptor(Array.prototype, 1);
36 assertEq(desc.get, getterFunction);
37 assertEq(desc.set, setterFunction);
38 assertEq(desc.enumerable, false);
39 assertEq(desc.configurable, false);
40 assertEq([][1], "getter");
42 assertEq(called, false);
44 if (typeof reportCompare === "function")
45 reportCompare(true, true);
47 print("Tests complete");