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 // frame.live is false for frames discarded during uncatchable error unwinding.
3 var g = newGlobal();
4 var dbg = Debugger(g);
5 var hits = 0;
6 var snapshot;
7 dbg.onDebuggerStatement = function (frame) {
8 var stack = [];
9 for (var f = frame; f; f = f.older) {
10 if (f.type === "call" && f.script !== null)
11 stack.push(f);
12 }
13 snapshot = stack;
14 if (hits++ === 0)
15 assertEq(frame.eval("x();"), null);
16 else
17 return null;
18 };
20 g.eval("function z() { debugger; }");
21 g.eval("function y() { z(); }");
22 g.eval("function x() { y(); }");
23 assertEq(g.eval("debugger; 'ok';"), "ok");
24 assertEq(hits, 2);
25 assertEq(snapshot.length, 3);
26 for (var i = 0; i < snapshot.length; i++)
27 assertEq(snapshot[i].live, false);