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