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 t1() {
2 assertEq(thisValue, this);
3 }
5 thisValue = {};
6 var f1 = t1.bind(thisValue);
7 f1()
8 f1()
10 ////////////////////////////////////////////////////////////
12 function t2() {
13 bailout();
14 }
16 var f2 = t2.bind(thisValue);
17 f2()
18 f2()
20 ////////////////////////////////////////////////////////////
22 function test3() {
23 function i3(a,b,c,d) {
24 bailout();
25 }
27 function t3(a,b,c,d) {
28 i3(a,b,c,d);
29 }
31 var f3 = t3.bind(thisValue);
32 for (var i=0;i<10; i++) {
33 f3(1,2,3,4)
34 f3(1,2,3,4)
35 }
36 }
37 test3();
38 test3();
40 ////////////////////////////////////////////////////////////
42 function test4() {
43 this.a = 1;
44 var inner = function(a,b,c,d) {
45 bailout();
46 }
48 var t = function(a,b,c,d) {
49 assertEq(this.a, undefined);
50 inner(a,b,c,d);
51 assertEq(this.a, undefined);
52 }
54 var f = t.bind(thisValue);
55 for (var i=0;i<5; i++) {
56 var res = f(1,2,3,4)
57 var res2 = new f(1,2,3,4)
58 assertEq(res, undefined);
59 assertEq(res2 == undefined, false);
60 }
61 }
62 test4();
63 test4();
65 ////////////////////////////////////////////////////////////
67 function test5() {
68 this.a = 1;
69 var inner = function(a,b,c,d) {
70 assertEq(a, 1);
71 assertEq(b, 2);
72 assertEq(c, 3);
73 assertEq(d, 1);
74 bailout();
75 assertEq(a, 1);
76 assertEq(b, 2);
77 assertEq(c, 3);
78 assertEq(d, 1);
79 }
81 var t = function(a,b,c,d) {
82 inner(a,b,c,d);
83 }
85 var f = t.bind(thisValue, 1,2,3);
86 for (var i=0;i<5; i++) {
87 f(1,2,3,4)
88 }
89 }
90 test5();
91 test5();
93 ////////////////////////////////////////////////////////////
95 function test6() {
96 function i6(a,b,c,d) {
97 if (a == 1)
98 bailout();
99 }
101 function t6(a,b,c,d) {
102 i6(a,b,c,d);
103 }
105 var f6 = t6.bind(thisValue, 1);
106 f6(1,2,3,4)
107 f6(0,2,3,4)
108 }
109 test6();
110 test6();