]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/varargs-exit.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / varargs-exit.js
CommitLineData
ed1e77d3
A
1function foo(a, b) {
2 return a + b;
3}
4
5function bar() {
6 var a = arguments;
7 var tmp = arguments[0] + 1;
8 return tmp + foo.apply(null, a);
9}
10
11noInline(bar);
12
13for (var i = 0; i < 10000; ++i) {
14 var result = bar(1, 2);
15 if (result != 1 + 1 + 3)
16 throw "Error: bad result: " + result;
17}
18
19var result = bar(1.5, 2);
20if (result != 1.5 + 1 + 3.5)
21 throw "Error: bad result at end: " + result;