Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1306)

Unified Diff: test/mjsunit/es6/regexp-sticky.js

Issue 2510743003: [regexp] Fix matching of regexps that are both sticky and anchored at end. (Closed)
Patch Set: Reformat Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/regexp/jsregexp.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/regexp-sticky.js
diff --git a/test/mjsunit/es6/regexp-sticky.js b/test/mjsunit/es6/regexp-sticky.js
index c0633f9173eb645a71b1718fbae6dabc1b7af9ab..df39763694334b97eb6141232d1a9529c4d8238c 100644
--- a/test/mjsunit/es6/regexp-sticky.js
+++ b/test/mjsunit/es6/regexp-sticky.js
@@ -128,3 +128,10 @@ mhat.lastIndex = 2;
assertFalse(mhat.test("..foo"));
mhat.lastIndex = 2;
assertTrue(mhat.test(".\nfoo"));
+
+// Check that we don't apply incorrect optimization to sticky regexps that
+// are anchored at end.
+var stickyanchored = /bar$/y;
+assertFalse(stickyanchored.test("foobar"));
+stickyanchored.lastIndex = 3;
+assertTrue(stickyanchored.test("foobar"));
« no previous file with comments | « src/regexp/jsregexp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698