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

Unified Diff: test/mjsunit/regexp-global.js

Issue 10383280: Remove unnecessary code for non-zero-length global regexps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 months 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
« src/regexp-macro-assembler.h ('K') | « src/x64/regexp-macro-assembler-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regexp-global.js
diff --git a/test/mjsunit/regexp-global.js b/test/mjsunit/regexp-global.js
index fac5c6af03fd11dfcb3a4527d948c0e56b47315d..fd61390e0d7ee9956e8abadf5b6028b5b61bfac4 100644
--- a/test/mjsunit/regexp-global.js
+++ b/test/mjsunit/regexp-global.js
@@ -125,3 +125,12 @@ str = str.replace(/(FOUR|TWO) \u817f (GOOD|BAD)/g,
return match.length - 7;
});
assertEquals("4, 2!", str);
+
+// Test zero-length matches that have non-zero-length sub-captures that do not
+// start at the match start position.
+str = "up up up up";
+str = str.replace(/\b(?=u(p))/g, function(match, capture) {
+ return capture.length;
+ });
+
+assertEquals("1up 1up 1up 1up", str);
« src/regexp-macro-assembler.h ('K') | « src/x64/regexp-macro-assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698