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 // After an implicit toString call throws an exception, the calling frame's
2 // onStep hook fires.
4 var g = newGlobal();
5 g.eval("var x = {toString: function () { debugger; log += 'x'; throw 'mud'; }};");
7 var dbg = Debugger(g);
8 dbg.onDebuggerStatement = function (frame) {
9 g.log += 'd';
10 frame.older.onStep = function () {
11 if (!g.log.match(/[sy]$/))
12 g.log += 's';
13 };
14 };
16 g.log = '';
17 g.eval("try { x + ''; } catch (x) { }\n" +
18 "log += 'y';\n");
19 assertEq(g.log, "dxsy");
21 g.log = '';
22 g.eval("try { '' + x; } catch (x) { }\n" +
23 "log += 'y';\n");
24 assertEq(g.log, "dxsy");