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 // Debugger.prototype.onDebuggerStatement
3 load(libdir + 'asserts.js');
5 var g = newGlobal();
6 var dbg = new Debugger(g);
7 gc(); // don't assert marking debug hooks
8 assertEq(dbg.onDebuggerStatement, undefined);
10 function f() {}
12 assertThrowsInstanceOf(function () { dbg.onDebuggerStatement = null; }, TypeError);
13 assertThrowsInstanceOf(function () { dbg.onDebuggerStatement = "bad"; }, TypeError);
14 assertThrowsInstanceOf(function () { dbg.onDebuggerStatement = {}; }, TypeError);
15 dbg.onDebuggerStatement = f;
16 assertEq(dbg.onDebuggerStatement, f);
18 assertEq(Object.getOwnPropertyNames(dbg).length, 0);
19 var desc = Object.getOwnPropertyDescriptor(Debugger.prototype, "onDebuggerStatement");
20 assertEq(desc.configurable, true);
21 assertEq(desc.enumerable, false);
23 assertThrowsInstanceOf(function () { desc.get(); }, TypeError);
24 assertThrowsInstanceOf(function () { desc.get.call(undefined); }, TypeError);
25 assertThrowsInstanceOf(function () { desc.get.call(Debugger.prototype); }, TypeError);
26 assertEq(desc.get.call(dbg), f);
28 assertThrowsInstanceOf(function () { desc.set(); }, TypeError);
29 assertThrowsInstanceOf(function () { desc.set.call(dbg); }, TypeError);
30 assertThrowsInstanceOf(function () { desc.set.call({}, f); }, TypeError);
31 assertThrowsInstanceOf(function () { desc.set.call(Debugger.prototype, f); }, TypeError);