]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/regexp-matches-array.js
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / tests / stress / regexp-matches-array.js
diff --git a/tests/stress/regexp-matches-array.js b/tests/stress/regexp-matches-array.js
new file mode 100644 (file)
index 0000000..6ccb27a
--- /dev/null
@@ -0,0 +1,14 @@
+function testArrayConcat() {
+    var array = 'abc'.match(/(a)(b)(c)/);
+    var result = array.concat();
+    var expectedResult = ["abc", "a", "b", "c"];
+
+    if (result.length != 4)
+        throw new Error("Runtime array length is incorrect");
+    for (var i = 0; i < result.length; i++) {
+        if (result[i] != expectedResult[i])
+            throw new Error("Runtime array concat result is incorrect");
+    }
+};
+
+testArrayConcat();