diff options
Diffstat (limited to 'chromium/v8/src/regexp/regexp-parser.cc')
-rw-r--r-- | chromium/v8/src/regexp/regexp-parser.cc | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/chromium/v8/src/regexp/regexp-parser.cc b/chromium/v8/src/regexp/regexp-parser.cc index b0dcaa8ee95..d433fc8578a 100644 --- a/chromium/v8/src/regexp/regexp-parser.cc +++ b/chromium/v8/src/regexp/regexp-parser.cc @@ -1430,14 +1430,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--) { |