]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/for-in-tests.js
fc6258e4e0770a8f1e5d5282826f4a04ded30639
2 // Iterate over an array with normal indexed properties.
4 var a
= [1, 2, 3, 4, 5];
12 for (var i
= 0; i
< 10000; ++i
) {
13 if (foo() !== "12345")
14 throw new Error("bad result");
19 // Iterate over an object with normal non-indexed properties.
20 var foo = function() {
31 for (var i
= 0; i
< 10000; ++i
) {
33 throw new Error("bad result");
38 // Iterate over an object with both indexed and non-indexed properties.
39 var foo = function() {
53 for (var i
= 0; i
< 10000; ++i
) {
54 if (foo() != "456123")
55 throw new Error("bad result");
60 // Iterate over an array with both indexed and non-indexed properties.
61 var foo = function() {
72 for (var i
= 0; i
< 10000; ++i
) {
73 if (foo() !== "456123")
74 throw new Error("bad result");
79 var foo = function(a
, b
) {
89 for (var i
= 0; i
< 10000; ++i
) {
96 throw new Error("bad result: " + o1
.x
+ "!==" + o2
.x
);
98 throw new Error("bad result: " + o1
.y
+ "!==" + o2
.y
);