summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/String/match-forward-lookahead.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/String/match-forward-lookahead.js')
-rw-r--r--js/src/tests/non262/String/match-forward-lookahead.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/js/src/tests/non262/String/match-forward-lookahead.js b/js/src/tests/non262/String/match-forward-lookahead.js
new file mode 100644
index 0000000000..6097b66044
--- /dev/null
+++ b/js/src/tests/non262/String/match-forward-lookahead.js
@@ -0,0 +1,27 @@
+/*
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/licenses/publicdomain/
+ */
+
+var BUGNUMBER = 501739;
+var summary =
+ "String.prototype.match behavior with zero-length matches involving " +
+ "forward lookahead";
+
+print(BUGNUMBER + ": " + summary);
+
+/**************
+ * BEGIN TEST *
+ **************/
+
+var r = /(?=x)/g;
+
+var res = "aaaaaaaaaxaaaaaaaaax".match(r);
+assertEq(res.length, 2);
+
+/******************************************************************************/
+
+if (typeof reportCompare === "function")
+ reportCompare(true, true);
+
+print("Tests complete");