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

Unified Diff: src/string.js

Issue 18193: Add support for \b and ^ and $ in multiline mode, completing Irregexp... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 11 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
Index: src/string.js
===================================================================
--- src/string.js (revision 1094)
+++ src/string.js (working copy)
@@ -572,6 +572,9 @@
if (ovector == null) return null;
var nof_results = ovector.length >> 1;
var result = new $Array(nof_results + 1);
+ // Section 15.5.4.14 paragraph two says that we do not allow zero length
+ // matches at the end of the string.
+ if (ovector[0] === subject.length) return null;
result[0] = ovector[1];
result[1] = subject.slice(current_index, ovector[0]);
for (var i = 1; i < nof_results; i++) {

Powered by Google App Engine
This is Rietveld 408576698