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