Index: test/mjsunit/regress/regress-2437.js |
diff --git a/test/mjsunit/regress/regress-2437.js b/test/mjsunit/regress/regress-2437.js |
index c82293ae3252872c6873b2c0025934eb7d101e98..66f0abfef582503751c6ad0164de26fc295aa8a9 100644 |
--- a/test/mjsunit/regress/regress-2437.js |
+++ b/test/mjsunit/regress/regress-2437.js |
@@ -26,7 +26,7 @@ |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// Summary of the spec: lastIndex is reset to 0 if |
-// - a regexp fails to match, regardless of global or non-global. |
+// - a global or sticky regexp fails to match. |
// - a global regexp is used in a function that returns multiple results, |
// such as String.prototype.replace or String.prototype.match, since it |
// repeats the regexp until it fails to match. |
@@ -37,19 +37,19 @@ |
r = /a/; |
r.lastIndex = 1; |
r.exec("zzzz"); |
-assertEquals(0, r.lastIndex); |
+assertEquals(1, r.lastIndex); |
// Test Regexp.prototype.test |
r = /a/; |
r.lastIndex = 1; |
r.test("zzzz"); |
-assertEquals(0, r.lastIndex); |
+assertEquals(1, r.lastIndex); |
// Test String.prototype.match |
r = /a/; |
r.lastIndex = 1; |
"zzzz".match(r); |
-assertEquals(0, r.lastIndex); |
+assertEquals(1, r.lastIndex); |
// Test String.prototype.replace with atomic regexp and empty string. |
r = /a/; |
@@ -116,7 +116,7 @@ assertEquals(-1, r.lastIndex); |
r.lastIndex = -1; |
"01234567".match(r); |
-assertEquals(0, r.lastIndex); |
+assertEquals(-1, r.lastIndex); |
// Also test RegExp.prototype.exec and RegExp.prototype.test |
r = /a/g; |
@@ -131,7 +131,7 @@ assertEquals(5, r.lastIndex); |
r = /a/; |
r.lastIndex = 1; |
r.exec("01234567"); |
-assertEquals(0, r.lastIndex); |
+assertEquals(1, r.lastIndex); |
r.lastIndex = 1; |
r.exec("0123abcd"); |
@@ -149,7 +149,7 @@ assertEquals(5, r.lastIndex); |
r = /a/; |
r.lastIndex = 1; |
r.test("01234567"); |
-assertEquals(0, r.lastIndex); |
+assertEquals(1, r.lastIndex); |
r.lastIndex = 1; |
r.test("0123abcd"); |