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.Frame.prototype.this in functions, with object values
3 function classOf(obj) {
4 return Object.prototype.toString.call(obj).match(/^\[object (.*)\]$/)[1];
5 }
7 var g = newGlobal();
8 var dbg = new Debugger(g);
9 var hits = 0;
10 dbg.onDebuggerStatement = function (frame) {
11 hits++;
12 assertEq(frame.this instanceof Debugger.Object, true);
13 assertEq(frame.this.class, classOf(Object(g.v)));
14 };
16 g.eval("function f() { debugger; }");
18 g.eval("v = {}; f.call(v);");
19 g.eval("v.f = f; v.f();");
20 g.eval("v = new Date; f.call(v);");
21 g.eval("v.f = f; v.f();");
22 g.eval("v = []; f.call(v);");
23 g.eval("Object.prototype.f = f; v.f();");
24 g.eval("v = this; f();");
25 assertEq(hits, 7);