]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/arguments-copy-register-array-backing-store.js
1e64f7b460e4c296e1ded4a9c5124f482cde762b
1 var foo = function(o
) {
6 var a
= Array
.prototype.slice
.call(arguments
);
8 for (var i
= 0; i
< a
.length
; ++i
)
13 var args
= foo({}, 1, 2, 3);
14 var expectedArgs
= Array
.prototype.slice
.call(args
);
18 var expectedResult
= 0;
20 for (var i
= 0; i
< 10000; ++i
) {
21 expectedResult
+= i
+ i
+ 1 + i
+ 2;
22 result
+= bar(i
, i
+ 1, i
+ 2);
25 if (result
!= expectedResult
)
26 throw new Error("Incorrect result: " + result
+ " != " + expectedResult
);
28 for (var i
= 0; i
< expectedArgs
.length
; ++i
) {
29 if (args
[i
] !== expectedArgs
[i
])
30 throw new Error("Incorrect arg result");