Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 function testApplyCallHelper(f) {
2 var r = [];
3 for (var i = 0; i < 10; ++i) f.call();
4 r.push(x);
5 for (var i = 0; i < 10; ++i) f.call(this);
6 r.push(x);
7 for (var i = 0; i < 10; ++i) f.apply(this);
8 r.push(x);
9 for (var i = 0; i < 10; ++i) f.call(this,0);
10 r.push(x);
11 for (var i = 0; i < 10; ++i) f.apply(this,[0]);
12 r.push(x);
13 for (var i = 0; i < 10; ++i) f.call(this,0,1);
14 r.push(x);
15 for (var i = 0; i < 10; ++i) f.apply(this,[0,1]);
16 r.push(x);
17 for (var i = 0; i < 10; ++i) f.call(this,0,1,2);
18 r.push(x);
19 for (var i = 0; i < 10; ++i) f.apply(this,[0,1,2]);
20 r.push(x);
21 for (var i = 0; i < 10; ++i) f.call(this,0,1,2,3);
22 r.push(x);
23 for (var i = 0; i < 10; ++i) f.apply(this,[0,1,2,3]);
24 r.push(x);
25 for (var i = 0; i < 10; ++i) f.call(this,0,1,2,3,4);
26 r.push(x);
27 for (var i = 0; i < 10; ++i) f.apply(this,[0,1,2,3,4]);
28 r.push(x);
29 for (var i = 0; i < 10; ++i) f.call(this,0,1,2,3,4,5);
30 r.push(x);
31 for (var i = 0; i < 10; ++i) f.apply(this,[0,1,2,3,4,5])
32 r.push(x);
33 return(r.join(","));
34 }
35 function testApplyCall() {
36 var r = testApplyCallHelper(function (a0,a1,a2,a3,a4,a5,a6,a7) { x = [a0,a1,a2,a3,a4,a5,a6,a7]; });
37 r += testApplyCallHelper(function (a0,a1,a2,a3,a4,a5,a6,a7) { x = [a0,a1,a2,a3,a4,a5,a6,a7]; });
38 return r;
39 }
41 assertEq(testApplyCall(), ",,,,,,,,,,,,,,,,,,,,,,,,0,,,,,,,,0,,,,,,,,0,1,,,,,,,0,1,,,,,,,0,1,2,,,,,,0,1,2,,,,,,0,1,2,3,,,,,0,1,2,3,,,,,0,1,2,3,4,,,,0,1,2,3,4,,,,0,1,2,3,4,5,,,0,1,2,3,4,5,," +
42 ",,,,,,,,,,,,,,,,,,,,,,,,0,,,,,,,,0,,,,,,,,0,1,,,,,,,0,1,,,,,,,0,1,2,,,,,,0,1,2,,,,,,0,1,2,3,,,,,0,1,2,3,,,,,0,1,2,3,4,,,,0,1,2,3,4,,,,0,1,2,3,4,5,,,0,1,2,3,4,5,,");