js/src/jit-test/tests/ion/bug824473.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 function dumpArgs(i) { if (i == 90) return funapply.arguments.length; return [i]; }
michael@0 2 function funapply() { return dumpArgs.apply({}, arguments); }
michael@0 3 function test(i) { return funapply(i); }
michael@0 4
michael@0 5 assertEq(test(89)[0], 89);
michael@0 6 assertEq(test(90), 1);
michael@0 7
michael@0 8 function dumpArgs2(i,b) { if (i == 90) return funapply2.arguments.length; return [i]; }
michael@0 9 function funapply2() { return dumpArgs2.apply({}, arguments); }
michael@0 10 function test2(i,b) { return funapply2(i,b); }
michael@0 11
michael@0 12 assertEq(test2(89, 10)[0], 89);
michael@0 13 assertEq(test2(90, 10), 2);
michael@0 14
michael@0 15 function dumpArgs3(i,b) { if (i == 90) return funapply3.arguments.length; return [i]; }
michael@0 16 function funapply3() { return dumpArgs3.apply({}, arguments); }
michael@0 17 function test3(i,b, c) { return funapply3(i,b,c); }
michael@0 18
michael@0 19 assertEq(test3(89, 10, 11)[0], 89);
michael@0 20 assertEq(test3(90, 10, 11), 3);
michael@0 21
michael@0 22 function dumpArgs4(i) { if (i == 90) return funapply4.arguments.length; return [i]; }
michael@0 23 function funapply4() { return dumpArgs4.apply({}, arguments); }
michael@0 24 function test4(i,b) { return funapply4(i,b,1,2); }
michael@0 25
michael@0 26 assertEq(test4(89,10)[0], 89);
michael@0 27 assertEq(test4(90,10), 4);
michael@0 28
michael@0 29 function dumpArgs5(i,j,k,l) { if (i == 90) return funapply5.arguments.length*10 + l; return [i]; }
michael@0 30 function funapply5() { return dumpArgs5.apply({}, arguments); }
michael@0 31 function test5(i,b) { return funapply5(i,b,1,2); }
michael@0 32
michael@0 33 assertEq(test5(89,10)[0], 89);
michael@0 34 assertEq(test5(90,10), 42);
michael@0 35
michael@0 36 function dumpArgs6(i) { if (i == 90) return funapply6.arguments.length; return [i]; }
michael@0 37 function funapply6() { return dumpArgs6.apply({}, arguments); }
michael@0 38 function test6(i) { return funapply6(i,1,2,3); }
michael@0 39
michael@0 40 assertEq(test6(89)[0], 89);
michael@0 41 assertEq(test6(90), 4);

mercurial