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 magicNumbers = [1, -1, 0, 0];
2 var magicIndex = 0;
4 var sum = 0;
6 function foo(n) {
7 for (var i = 0; i < n; ++i) {
8 sum += 10;
9 bar();
10 }
11 }
13 function bar() {
14 var q = magicNumbers[magicIndex++];
15 if (q != -1) {
16 sum += 1;
17 foo(q);
18 }
19 }
21 foo(3);
22 assertEq(sum, 43);