]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/phantom-direct-arguments-clobber-argument-count.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / phantom-direct-arguments-clobber-argument-count.js
1 function foo() {
2 return effectful42.apply(this, arguments);
3 }
4
5 function bar(a, b) {
6 var result = foo.apply(this, b);
7 return [a, a, a, a, a, a, a, a, result + a];
8 }
9
10 noInline(bar);
11
12 for (var i = 0; i < 10000; ++i) {
13 var result = "" + bar(1, []);
14 if (result != "1,1,1,1,1,1,1,1,43")
15 throw "Error: bad result: " + result;
16 }
17
18 var result = "" + bar(2147483647, []);
19 if (result != "2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483689")
20 throw "Error: bad result at end: " + result;