]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/arguments-captured.js
0b1e1ab062b9f3ab9ee186eaef5023e984f64da0
[apple/javascriptcore.git] / tests / stress / arguments-captured.js
1 function foo(o) {
2 o[0] = 42;
3 }
4
5 function bar(a) {
6 var o = {};
7 o.f = a;
8 foo(arguments);
9 o.g = a;
10 return o;
11 }
12
13 noInline(foo);
14 noInline(bar);
15
16 for (var i = 0; i < 1000; ++i) {
17 var result = bar(i);
18 if (result.f != i)
19 throw "Error: bad value of f: " + result.f;
20 if (result.g != 42)
21 throw "Error: bad value of g: " + result.g;
22 }
23