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 desc = Object.getOwnPropertyDescriptor(Debugger.prototype, "enabled");
2 assertEq(typeof desc.get, 'function');
3 assertEq(typeof desc.set, 'function');
5 var g = newGlobal();
6 var hits;
7 var dbg = new Debugger(g);
8 assertEq(dbg.enabled, true);
9 dbg.onDebuggerStatement = function () { hits++; };
11 var vals = [true, false, null, undefined, NaN, "blah", {}];
12 for (var i = 0; i < vals.length; i++) {
13 dbg.enabled = vals[i];
14 assertEq(dbg.enabled, !!vals[i]);
15 hits = 0;
16 g.eval("debugger;");
17 assertEq(hits, vals[i] ? 1 : 0);
18 }