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.
michael@0 | 1 | function x4(v) { return "" + v + v + v + v; } |
michael@0 | 2 | function testConvertibleObjectEqUndefined() |
michael@0 | 3 | { |
michael@0 | 4 | var compares = |
michael@0 | 5 | [ |
michael@0 | 6 | false, false, false, false, |
michael@0 | 7 | undefined, undefined, undefined, undefined, |
michael@0 | 8 | false, false, false, false, |
michael@0 | 9 | undefined, undefined, undefined, undefined, |
michael@0 | 10 | false, false, false, false, |
michael@0 | 11 | undefined, undefined, undefined, undefined, |
michael@0 | 12 | false, false, false, false, |
michael@0 | 13 | undefined, undefined, undefined, undefined, |
michael@0 | 14 | false, false, false, false, |
michael@0 | 15 | undefined, undefined, undefined, undefined, |
michael@0 | 16 | ]; |
michael@0 | 17 | var count = 0; |
michael@0 | 18 | var obj = { valueOf: function() { count++; return 1; } }; |
michael@0 | 19 | var results = compares.map(function(v) { return "unwritten"; }); |
michael@0 | 20 | |
michael@0 | 21 | for (var i = 0, sz = compares.length; i < sz; i++) |
michael@0 | 22 | results[i] = compares[i] == obj; |
michael@0 | 23 | |
michael@0 | 24 | return results.join("") + count; |
michael@0 | 25 | } |
michael@0 | 26 | |
michael@0 | 27 | assertEq(testConvertibleObjectEqUndefined(), |
michael@0 | 28 | x4(false) + x4(false) + x4(false) + x4(false) + x4(false) + x4(false) + |
michael@0 | 29 | x4(false) + x4(false) + x4(false) + x4(false) + "20"); |
michael@0 | 30 |