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