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