Reland b5ebe47700ce
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 08 Jul 2011 18:20:04 -0700
changeset 75192 4873f63c9d51c9f33d7ecea33c92c4f8704aaece
parent 75191 bfb3327952fd07aa05055444b2ed6ab75ba26945
child 75193 fd60ba97753ba9904c0f9344a8e212cf2384ab89
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone8.0a1
Reland b5ebe47700ce
js/src/tests/ecma_5/RegExp/jstests.list
js/src/tests/ecma_5/RegExp/regress-613820-1.js
js/src/tests/ecma_5/RegExp/regress-613820-2.js
js/src/tests/ecma_5/RegExp/regress-613820-3.js
--- a/js/src/tests/ecma_5/RegExp/jstests.list
+++ b/js/src/tests/ecma_5/RegExp/jstests.list
@@ -1,10 +1,13 @@
 url-prefix ../../jsreftest.html?test=ecma_5/RegExp/
 script 7.8.5-01.js
 script 15.10.5-01.js
 script 15.10.7.5-01.js
 script empty-lookahead.js
 script exec.js
 script exec-lastIndex-ToInteger.js
 script regress-576828.js
+script regress-613820-1.js
+script regress-613820-2.js
+script regress-613820-3.js
 silentfail skip-if(!xulRuntime.shell&&(Android||xulRuntime.OS=="WINNT")) script regress-617935.js
 script instance-property-storage-introspection.js
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_5/RegExp/regress-613820-1.js
@@ -0,0 +1,9 @@
+/* Back reference is actually a forwards reference. */
+var re = /(\2(a)){2}/;
+var str = 'aaa';
+var actual = re.exec(str);
+var expected = makeExpectedMatch(['aa', 'a', 'a'], 0, str);
+checkRegExpMatch(actual, expected);
+
+if (typeof reportCompare === 'function')
+    reportCompare(true, true);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_5/RegExp/regress-613820-2.js
@@ -0,0 +1,9 @@
+/* Resetting of inner capture groups across quantified capturing parens. */
+var re = /(?:(f)(o)(o)|(b)(a)(r))*/;
+var str = 'foobar';
+var actual = re.exec(str);
+var expected = makeExpectedMatch(['foobar', undefined, undefined, undefined, 'b', 'a', 'r'], 0, str);
+checkRegExpMatch(actual, expected);
+
+if (typeof reportCompare === 'function')
+    reportCompare(true, true);
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_5/RegExp/regress-613820-3.js
@@ -0,0 +1,9 @@
+/* Capture group reset to undefined during second iteration, so backreference doesn't see prior result. */
+var re = /(?:^(a)|\1(a)|(ab)){2}/;
+var str = 'aab';
+var actual = re.exec(str);
+var expected = makeExpectedMatch(['aa', undefined, 'a', undefined], 0, str);
+checkRegExpMatch(actual, expected);
+
+if (typeof reportCompare === 'function')
+    reportCompare(true, true);