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

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

Issue 2005753003: [regexp] fix /ui regexp desugaring for text nodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5036.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 0481c838c6f1781cee66bd45064a3fa64b5a67e4..abb644ac3f8057c91c5648177b6b8bdc4d4e3f14 100644
--- a/src/regexp/regexp-parser.cc
+++ b/src/regexp/regexp-parser.cc
@@ -1473,14 +1473,10 @@ void RegExpBuilder::FlushTerms() {
bool RegExpBuilder::NeedsDesugaringForUnicode(RegExpCharacterClass* cc) {
if (!unicode()) return false;
- switch (cc->standard_type()) {
- case 's': // white space
- case 'w': // ASCII word character
- case 'd': // ASCII digit
- return false; // These characters do not need desugaring.
- default:
- break;
- }
+ // TODO(yangguo): we could be smarter than this. Case-insensitivity does not
+ // necessarily mean that we need to desugar. It's probably nicer to have a
+ // separate pass to figure out unicode desugarings.
+ if (ignore_case()) return true;
ZoneList<CharacterRange>* ranges = cc->ranges(zone());
CharacterRange::Canonicalize(ranges);
for (int i = ranges->length() - 1; i >= 0; i--) {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5036.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698