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 // Environments of different instances of the same generator have the same
2 // callee. I love this job.
4 var g = newGlobal();
5 var dbg = new Debugger;
6 var gw = dbg.addDebuggee(g);
8 function check(gen, label) {
9 print("check(" + label + ")");
10 var hits;
11 dbg.onDebuggerStatement = function (frame) {
12 hits++;
13 var env = frame.environment;
14 assertEq(env.callee, gw.makeDebuggeeValue(g.f));
15 };
16 hits = 0;
17 gen.next();
18 assertEq(hits, 1);
19 }
21 g.eval('function f(x) { debugger; yield x; }');
22 g.eval('var g = f(2);');
23 g.eval('var h = f(3);');
24 check(g.g, 'g.g');
25 check(g.h, 'g.h');
27 g.eval('function* f(x) { debugger; yield x; }');
28 g.eval('var g = f(2);');
29 g.eval('var h = f(3);');
30 check(g.g, 'g.g');
31 check(g.h, 'g.h');