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 function toSource(o) { return o === null ? "null" : o.toSource(); }
3 var gcgcz = /((?:.)+)((?:.)*)/; /* Greedy capture, greedy capture zero. */
4 reportCompare(["a", "a", ""].toSource(), gcgcz.exec("a").toSource());
5 reportCompare(["ab", "ab", ""].toSource(), gcgcz.exec("ab").toSource());
6 reportCompare(["abc", "abc", ""].toSource(), gcgcz.exec("abc").toSource());
8 reportCompare(["a", ""].toSource(), toSource(/((?:)*?)a/.exec("a")));
9 reportCompare(["a", ""].toSource(), toSource(/((?:.)*?)a/.exec("a")));
10 reportCompare(["a", ""].toSource(), toSource(/a((?:.)*)/.exec("a")));
12 reportCompare(["B", "B"].toSource(), toSource(/([A-Z])/.exec("fooBar")));
14 // These just mustn't crash. See bug 872971
15 try { reportCompare(/x{2147483648}x/.test('1'), false); } catch (e) {}
16 try { reportCompare(/x{2147483648,}x/.test('1'), false); } catch (e) {}
17 try { reportCompare(/x{2147483647,2147483648}x/.test('1'), false); } catch (e) {}
18 // Same for these. See bug 813366
19 try { reportCompare("".match(/.{2147483647}11/), null); } catch (e) {}
20 try { reportCompare("".match(/(?:(?=g)).{2147483648,}/ + ""), null); } catch (e) {}