X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/4be4e30906bcb8ee30b4d189205cb70bad6707ce..81345200c95645a1b0d2635520f96ad55dfde63f:/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 index 0000000..6ccb27a --- /dev/null +++ b/tests/stress/regexp-matches-array.js @@ -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();