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 // |jit-test| error: TestComplete
2 // onPop can change a termination into a throw.
4 load(libdir + "asserts.js");
5 var g = newGlobal();
6 var dbg = new Debugger(g);
8 function test(type, provocation) {
9 var log;
11 // Help people figure out which 'test' call failed.
12 print("type: " + uneval(type));
13 print("provocation: " + uneval(provocation));
15 dbg.onDebuggerStatement = function handleDebuggerStatement(f) {
16 log += 'd';
17 return null;
18 };
20 dbg.onEnterFrame = function handleEnterFrame(f) {
21 log += '(';
22 assertEq(f.type, type);
23 f.onPop = function handlePop(c) {
24 log += ')';
25 assertEq(c, null);
26 return { throw: 'snow' };
27 };
28 };
30 log = '';
31 assertThrowsValue(provocation, 'snow');
32 assertEq(log, "(d)");
34 print();
35 }
37 g.eval("function f() { debugger; return 'termination fail'; }");
38 test("call", g.f);
39 test("call", function () { return new g.f; });
40 test("eval", function () { return g.eval("debugger; \'termination fail\';"); });
41 test("global", function () { return g.evaluate("debugger; \'termination fail\';"); });
42 throw 'TestComplete';