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 | // Basic getOffsetLine test, using Error.lineNumber as the gold standard. |
michael@0 | 2 | |
michael@0 | 3 | var g = newGlobal(); |
michael@0 | 4 | var dbg = Debugger(g); |
michael@0 | 5 | var hits; |
michael@0 | 6 | dbg.onDebuggerStatement = function (frame) { |
michael@0 | 7 | var knownLine = frame.eval("line").return; |
michael@0 | 8 | assertEq(frame.script.getOffsetLine(frame.offset), knownLine); |
michael@0 | 9 | hits++; |
michael@0 | 10 | }; |
michael@0 | 11 | |
michael@0 | 12 | hits = 0; |
michael@0 | 13 | g.eval("var line = new Error().lineNumber; debugger;"); |
michael@0 | 14 | assertEq(hits, 1); |
michael@0 | 15 | |
michael@0 | 16 | hits = 0; |
michael@0 | 17 | g.eval("var s = 2 + 2;\n" + |
michael@0 | 18 | "s += 2;\n" + |
michael@0 | 19 | "line = new Error().lineNumber; debugger;\n" + |
michael@0 | 20 | "s += 2;\n" + |
michael@0 | 21 | "s += 2;\n" + |
michael@0 | 22 | "line = new Error().lineNumber; debugger;\n" + |
michael@0 | 23 | "s += 2;\n" + |
michael@0 | 24 | "assertEq(s, 12);\n"); |
michael@0 | 25 | assertEq(hits, 2); |