]> git.saurik.com Git - apple/javascriptcore.git/blame_incremental - tests/stress/arguments-captured.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / arguments-captured.js
... / ...
CommitLineData
1function foo(o) {
2 o[0] = 42;
3}
4
5function bar(a) {
6 var o = {};
7 o.f = a;
8 foo(arguments);
9 o.g = a;
10 return o;
11}
12
13noInline(foo);
14noInline(bar);
15
16for (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