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 // Any copyright is dedicated to the Public Domain.
2 // http://creativecommons.org/licenses/publicdomain/
4 // Don't assert trying to parse any of these.
5 var a = ["({''})",
6 "({''} = {})",
7 "var {''};",
8 "var {'', a} = {a: 0};",
9 "var {'bad'};",
10 "({'bad'} = {bad: 0});",
11 "var {'if'};",
12 "function f({''}) {}",
13 "function f({a, 'bad', c}) {}"];
15 var x;
16 for (var i = 0; i < a.length; i++) {
17 x = undefined;
18 try {
19 eval(a[i]);
20 } catch (exc) {
21 x = exc;
22 }
23 assertEq(x instanceof SyntaxError, true);
24 }
25 assertEq("" in this, false);
26 assertEq("bad" in this, false);
27 assertEq("if" in this, false);
29 reportCompare(0, 0, 'ok');