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--) { |