Index: test/mjsunit/regexp.js |
diff --git a/test/mjsunit/regexp.js b/test/mjsunit/regexp.js |
index 00bbfb962d2a700b8e07febb6b4d43235e585180..b6f019ea26a6c6d2e5c5787ccab8b9f0e957e5ee 100644 |
--- a/test/mjsunit/regexp.js |
+++ b/test/mjsunit/regexp.js |
@@ -722,3 +722,10 @@ assertThrows("RegExp.prototype.toString.call(true)", TypeError); |
assertThrows("RegExp.prototype.toString.call([])", TypeError); |
assertThrows("RegExp.prototype.toString.call({})", TypeError); |
assertThrows("RegExp.prototype.toString.call(function(){})", TypeError); |
+ |
+// Test mutually recursive capture and backreferences. |
+assertEquals(["b", "", ""], /(\2)b(\1)/.exec("aba")); |
+assertEquals(["a", "", ""], /(\2).(\1)/.exec("aba")); |
+assertEquals(["aba", "a", "a"], /(.\2).(\1)/.exec("aba")); |
+assertEquals(["acbc", "c", "c"], /a(.\2)b(\1)$/.exec("acbc")); |
+assertEquals(["acbc", "c", "c"], /a(.\2)b(\1)/.exec("aabcacbc")); |