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.eval works from an onPop handler.
2 var g = newGlobal();
3 g.eval('function f(a,b) { var x = "entablature", y; debugger; return x+y+a+b; }');
5 var dbg = new Debugger(g);
6 var log;
8 dbg.onDebuggerStatement = function handleDebugger(frame) {
9 log += 'd';
10 frame.onPop = handlePop;
11 };
13 function handlePop(c) {
14 log += ')';
16 // Arguments must be live.
17 assertEq(this.eval('a').return, 'frieze');
18 assertEq(this.eval('b = "architrave"').return, 'architrave');
19 assertEq(this.eval('arguments[1]').return, 'architrave');
20 assertEq(this.eval('b').return, 'architrave');
22 // function-scope variables must be live.
23 assertEq(this.eval('x').return, 'entablature');
24 assertEq(this.eval('y = "cornice"').return, 'cornice');
25 assertEq(this.eval('y').return, 'cornice');
26 }
28 log = '';
29 g.eval('f("frieze", "stylobate")');
30 assertEq(log, 'd)');