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

Unified Diff: src/regexp/regexp-parser.cc

Issue 1776953002: [regexp] allow loose matching for property names. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « src/char-predicates-inl.h ('k') | test/mjsunit/harmony/regexp-property-general-category.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/regexp-parser.cc
diff --git a/src/regexp/regexp-parser.cc b/src/regexp/regexp-parser.cc
index e94be02610fe91b7d909009652ac007657df55db..21992e42a64ee337a5448444f30e6f9cb050bf44 100644
--- a/src/regexp/regexp-parser.cc
+++ b/src/regexp/regexp-parser.cc
@@ -840,11 +840,11 @@ ZoneList<CharacterRange>* RegExpParser::ParsePropertyClass() {
#ifdef V8_I18N_SUPPORT
ZoneList<char> property_name(0, zone());
if (current() == '{') {
- for (Advance(); IsAlpha(current()); Advance()) {
+ for (Advance(); current() != '}'; Advance()) {
+ if (!has_next()) return nullptr;
property_name.Add(static_cast<char>(current()), zone());
}
- if (current() != '}') return nullptr;
- } else if (IsAlpha(current())) {
+ } else if (current() != kEndMarker) {
property_name.Add(static_cast<char>(current()), zone());
} else {
return nullptr;
« no previous file with comments | « src/char-predicates-inl.h ('k') | test/mjsunit/harmony/regexp-property-general-category.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698