]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/scoped-then-direct-arguments-get-by-val-in-baseline.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / scoped-then-direct-arguments-get-by-val-in-baseline.js
CommitLineData
ed1e77d3
A
1function direct() {
2 return arguments;
3}
4
5function scoped(a) {
6 if (!effectful42())
7 return function() { return a; }
8 return arguments;
9}
10
11function foo(a) {
12 try {
13 return a[0];
14 } catch (e) {
15 return -23;
16 }
17}
18
19for (var i = 0; i < 100; ++i) {
20 var result = foo(scoped(42));
21 if (result != 42)
22 throw "Error: bad result: " + result;
23}
24
25for (var i = 0; i < 100; ++i) {
26 var result = foo(direct(42));
27 if (result != 42)
28 throw "Error: bad result: " + result;
29}
30