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 // Test adding hooks during dispatch. The behavior is deterministic and "nice",
2 // but mainly what we are checking here is that we do not crash due to
3 // modifying a data structure while we're iterating over it.
5 var g = newGlobal();
6 var n = 0;
7 var hits;
9 function addDebugger() {
10 var dbg = new Debugger(g);
11 dbg.onDebuggerStatement = function (stack) {
12 hits++;
13 addDebugger();
14 };
15 }
17 addDebugger(); // now there is one enabled Debugger
18 hits = 0;
19 g.eval("debugger;"); // after this there are two
20 assertEq(hits, 1);
22 hits = 0;
23 g.eval("debugger;"); // after this there are four
24 assertEq(hits, 2);
26 hits = 0;
27 g.eval("debugger;"); // after this there are eight
28 assertEq(hits, 4);
30 hits = 0;
31 g.eval("debugger;");
32 assertEq(hits, 8);