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.
michael@0 | 1 | // uncaughtExceptionHook resumption value other than undefined causes further |
michael@0 | 2 | // hooks to be skipped. |
michael@0 | 3 | |
michael@0 | 4 | var g = newGlobal(); |
michael@0 | 5 | var log; |
michael@0 | 6 | |
michael@0 | 7 | function makeDebug(g, name) { |
michael@0 | 8 | var dbg = new Debugger(g); |
michael@0 | 9 | dbg.onDebuggerStatement = function (frame) { |
michael@0 | 10 | log += name; |
michael@0 | 11 | throw new Error(name); |
michael@0 | 12 | }; |
michael@0 | 13 | dbg.uncaughtExceptionHook = function (exc) { |
michael@0 | 14 | assertEq(exc.message, name); |
michael@0 | 15 | return name == "2" ? {return: 42} : undefined; |
michael@0 | 16 | }; |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | var arr = []; |
michael@0 | 20 | for (var i = 0; i < 6; i++) |
michael@0 | 21 | arr[i] = makeDebug(g, "" + i); |
michael@0 | 22 | |
michael@0 | 23 | log = ''; |
michael@0 | 24 | assertEq(g.eval("debugger;"), 42); |
michael@0 | 25 | assertEq(log, "012"); |