]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/for-in-string.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / for-in-string.js
diff --git a/tests/stress/for-in-string.js b/tests/stress/for-in-string.js
new file mode 100644 (file)
index 0000000..44640e6
--- /dev/null
@@ -0,0 +1,16 @@
+(function() {
+    // Iterate over characters in a string.
+    var o = "hello";
+    var foo = function(o) {
+        var result = "";
+        for (var s in o)
+            result += o[s];
+        return result;
+    };
+    noInline(foo);
+    for (var i = 0; i < 10000; ++i) {
+        if (foo("hello") !== "hello")
+            throw new Error("incorrect result");
+    }
+    foo(null);
+})();