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 function A() {};
2 A.prototype = [];
4 function B() {};
5 B.prototype = new A();
7 function C() {};
8 C.prototype = new B();
10 function D() {};
11 D.prototype = new C();
13 function E() {};
14 E.prototype = new D();
16 function f() {
17 var o = new B();
18 for (var i=0; i<10; i++)
19 o[i] = i;
21 var expected = '{"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9}';
22 assertEq(JSON.stringify(o), expected);
24 var o = new A();
25 for (var i=0; i<10; i++)
26 o[i] = i;
28 assertEq(JSON.stringify(o), expected);
30 var o = new D();
31 for (var i=0; i<10; i++)
32 o[i] = i;
34 assertEq(JSON.stringify(o), expected);
36 var o = new E();
37 for (var i=0; i<10; i++)
38 o[i] = i;
40 assertEq(JSON.stringify(o), expected);
41 }
42 f();