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 | // Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | // http://creativecommons.org/licenses/publicdomain/ |
michael@0 | 3 | |
michael@0 | 4 | function innermost() { return arguments.callee.caller; } |
michael@0 | 5 | function nest() { return eval("innermost();"); } |
michael@0 | 6 | function nest2() { return nest(); } |
michael@0 | 7 | |
michael@0 | 8 | assertEq(nest2(), nest); |
michael@0 | 9 | |
michael@0 | 10 | var innermost = function innermost() { return arguments.callee.caller.caller; }; |
michael@0 | 11 | |
michael@0 | 12 | assertEq(nest2(), nest2); |
michael@0 | 13 | |
michael@0 | 14 | function nestTwice() { return eval("eval('innermost();');"); } |
michael@0 | 15 | var nest = nestTwice; |
michael@0 | 16 | |
michael@0 | 17 | assertEq(nest2(), nest2); |
michael@0 | 18 | |
michael@0 | 19 | function innermostEval() { return eval("arguments.callee.caller"); } |
michael@0 | 20 | var innermost = innermostEval; |
michael@0 | 21 | |
michael@0 | 22 | assertEq(nest2(), nestTwice); |
michael@0 | 23 | |
michael@0 | 24 | function innermostEvalTwice() { return eval('eval("arguments.callee.caller");'); } |
michael@0 | 25 | var innermost = innermostEvalTwice; |
michael@0 | 26 | |
michael@0 | 27 | assertEq(nest2(), nestTwice); |
michael@0 | 28 | |
michael@0 | 29 | /******************************************************************************/ |
michael@0 | 30 | |
michael@0 | 31 | if (typeof reportCompare === "function") |
michael@0 | 32 | reportCompare(true, true); |
michael@0 | 33 | |
michael@0 | 34 | print("Tests complete"); |