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 loop(f, expected) { |
michael@0 | 2 | // This is the loop that breaks us. |
michael@0 | 3 | // At record time, f's parent is a Call object with no fp. |
michael@0 | 4 | // At second execute time, it is a Call object with fp, |
michael@0 | 5 | // and all the Call object's dslots are still JSVAL_VOID. |
michael@0 | 6 | for (var i = 0; i < 9; i++) |
michael@0 | 7 | assertEq(f(), expected); |
michael@0 | 8 | } |
michael@0 | 9 | |
michael@0 | 10 | function C(bad) { |
michael@0 | 11 | var x = bad; |
michael@0 | 12 | function f() { |
michael@0 | 13 | return x; // We trick TR::callProp() into emitting code that gets |
michael@0 | 14 | // JSVAL_VOID (from the Call object's dslots) |
michael@0 | 15 | // rather than the actual value (true or false). |
michael@0 | 16 | } |
michael@0 | 17 | this.m = f; |
michael@0 | 18 | return f; |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | var obj = { |
michael@0 | 22 | set m(f) { |
michael@0 | 23 | if (f()) // Call once to resolve x on the Call object, |
michael@0 | 24 | // for shape consistency. Otherwise loop gets |
michael@0 | 25 | // recorded twice. |
michael@0 | 26 | loop(f, true); |
michael@0 | 27 | } |
michael@0 | 28 | }; |
michael@0 | 29 | |
michael@0 | 30 | loop(C.call(obj, false), false); |
michael@0 | 31 | C.call(obj, true); |