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 re = /a(b)c/;
3 for (var i = 0; i < 10; i++) {
4 // These two are of a form where we can convert exec() to test().
5 if (!re.exec("abc")) print("huh?");
6 re.exec("abc");
7 }
9 RegExp.prototype.test = 1;
11 for (var i = 0; i < 10; i++) {
12 // These two are the same form, but we've replaced test(), so we must
13 // not convert.
14 if (!re.exec("abc")) print("huh?"); // don't crash/assert
15 re.exec("abc"); // don't crash/assert
16 }