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 g = newGlobal();
2 var dbg = new Debugger(g);
4 var hits = 0;
5 dbg.onDebuggerStatement = function(frame) {
6 ++hits;
7 frame.older.eval("escaped = function() { return y }");
8 }
10 var arr = [];
11 const N = 10;
13 for (var i = 0; i < N; ++i) {
14 g.escaped = undefined;
15 g.eval("function h() { debugger }");
16 g.eval("(function () { var y = {p:42}; h(); yield })().next();");
17 assertEq(g.eval("escaped().p"), 42);
18 arr.push(g.escaped);
19 }
21 gc();
23 for (var i = 0; i < N; ++i)
24 arr[i]();