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 var otherGlobalSameCompartment = newGlobal("same-compartment");
2 eval = otherGlobalSameCompartment.eval;
3 doesNotNeedParens(1, "if (xx) { }");
4 needParens(2, "if (1, xx) { }");
5 function doesNotNeedParens(section, pat) {
6 try {
7 f = new Function
8 } catch (e) {}
9 roundTripTest(section, f)
10 }
11 function needParens(section, pat, exp) {
12 var f, ft;
13 roundTripTest(section, f, exp)
14 }
15 function roundTripTest(section, f, exp) {
16 uf = "" + f
17 var euf;
18 try {
19 euf = eval("(" + uf + ")");
20 } catch (e) { }
21 + euf
22 }