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 test1(re, test) { |
michael@0 | 2 | return re.test(test); |
michael@0 | 3 | } |
michael@0 | 4 | |
michael@0 | 5 | assertEq(true, test1(/undefined/, undefined)); |
michael@0 | 6 | assertEq(true, test1(/undefined/, undefined)); |
michael@0 | 7 | |
michael@0 | 8 | function test2(re, test) { |
michael@0 | 9 | return re.test(test); |
michael@0 | 10 | } |
michael@0 | 11 | |
michael@0 | 12 | assertEq(true, test2(/null/, null)); |
michael@0 | 13 | assertEq(true, test2(/null/, null)); |
michael@0 | 14 | |
michael@0 | 15 | function test3(re, test) { |
michael@0 | 16 | return re.test(test); |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | assertEq(true, test3(/0/, 0)); |
michael@0 | 20 | assertEq(true, test3(/0/, 0)); |
michael@0 | 21 | |
michael@0 | 22 | function test4(re, test) { |
michael@0 | 23 | return re.test(test); |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | assertEq(true, test4(/12.12/, 12.12)); |
michael@0 | 27 | assertEq(true, test4(/12.12/, 12.12)); |
michael@0 | 28 | |
michael@0 | 29 | function test5(re, test) { |
michael@0 | 30 | return re.test(test); |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | assertEq(true, test5(/true/, true)); |
michael@0 | 34 | assertEq(true, test5(/false/, false)); |
michael@0 | 35 | assertEq(true, test5(/true/, true)); |
michael@0 | 36 | assertEq(true, test5(/false/, false)); |
michael@0 | 37 | |
michael@0 | 38 | function test6(re, test) { |
michael@0 | 39 | return re.test(test); |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | assertEq(true, test6(/object/, {})); |
michael@0 | 43 | assertEq(true, test6(/object/, {})); |
michael@0 | 44 | |
michael@0 | 45 | assertEq(true, test1(/test/, "test")); |
michael@0 | 46 | assertEq(true, test1(/test/, "test")); |
michael@0 | 47 | assertEq(true, test1(/undefined/, undefined)); |
michael@0 | 48 | assertEq(true, test1(/undefined/, undefined)); |
michael@0 | 49 | assertEq(true, test1(/null/, null)); |
michael@0 | 50 | assertEq(true, test1(/null/, null)); |
michael@0 | 51 | assertEq(true, test1(/0.1/, 0.1)); |
michael@0 | 52 | assertEq(true, test1(/0.1/, 0.1)); |
michael@0 | 53 | assertEq(true, test1(/20000/, 20000)); |
michael@0 | 54 | assertEq(true, test1(/20000/, 20000)); |
michael@0 | 55 | assertEq(true, test1(/object/, {})); |
michael@0 | 56 | assertEq(true, test1(/object/, {})); |
michael@0 | 57 | |
michael@0 | 58 |