]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/get-my-argument-by-val-inlined-no-formal-parameters.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / get-my-argument-by-val-inlined-no-formal-parameters.js
CommitLineData
40a37d08
A
1var index;
2
3function foo() {
4 if (index >= 0)
5 return arguments[index];
6 else
7 return 13;
8}
9
10function bar() {
11 return foo();
12}
13
14noInline(bar);
15
16for (var i = 0; i < 100; ++i) {
17 index = i & 1;
18 var result = foo(42, 53);
19 if (result != [42, 53][index])
20 throw "Error: bad result in first loop: " + result;
21}
22
23for (var i = 0; i < 100000; ++i) {
24 index = -(i & 1) - 1;
25 var result = bar();
26 if (result !== 13)
27 throw "Error: bad result in second loop: " + result;
28}
29
30index = 0;
31var result = bar();
32if (result !== void 0)
33 throw "Error: bad result at end: " + result;