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 //-----------------------------------------------------------------------------
7 var BUGNUMBER = 722260;
8 var summary = 'All NaNs must be treated as identical keys for Set';
10 print(BUGNUMBER + ": " + summary);
12 /**************
13 * BEGIN TEST *
14 **************/
16 /* Avoid constant-folding that would happen were |undefined| to be used. */
17 var key = -/a/g.missingProperty;
19 var s = new Set();
20 s.add(key, 17);
21 assertEq(s.has(key), true);
22 assertEq(s.has(-key), true);
23 assertEq(s.has(NaN), true);
25 s.delete(-key);
26 assertEq(s.has(key), false);
27 assertEq(s.has(-key), false);
28 assertEq(s.has(NaN), false);
30 s.add(-key, 17);
31 assertEq(s.has(key), true);
32 assertEq(s.has(-key), true);
33 assertEq(s.has(NaN), true);
35 s.delete(NaN);
36 assertEq(s.has(key), false);
37 assertEq(s.has(-key), false);
38 assertEq(s.has(NaN), false);
40 s.add(NaN, 17);
41 assertEq(s.has(key), true);
42 assertEq(s.has(-key), true);
43 assertEq(s.has(NaN), true);
45 s.delete(key);
46 assertEq(s.has(key), false);
47 assertEq(s.has(-key), false);
48 assertEq(s.has(NaN), false);
51 /******************************************************************************/
53 if (typeof reportCompare === "function")
54 reportCompare(true, true);
56 print("Tests complete");