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