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 = 614608;
7 var summary = "String.prototype.split with undefined separator";
9 print(BUGNUMBER + ": " + summary);
11 /**************
12 * BEGIN TEST *
13 **************/
15 function assertEqArr(a1, a2) {
16 assertEq(a1.length, a2.length);
18 for(var i=0; i<a1.length; i++) {
19 assertEq(a1[i], a2[i]);
20 }
21 }
22 var s = '--undefined--undefined--';
24 assertEqArr(s.split(undefined, undefined), [s]);
25 assertEqArr(s.split(undefined, -1), [s]);
27 assertEqArr(s.split(undefined, 1), [s]);
28 assertEqArr(s.split("undefined", 1), ["--"]);
30 assertEqArr(s.split("-", 0), []);
31 assertEqArr(s.split(undefined, 0), []);
32 assertEqArr(s.split(s, 0), []);
34 if (typeof reportCompare === "function")
35 reportCompare(true, true);
37 print("All tests passed!");