Index: src/regexp/regexp-parser.cc |
diff --git a/src/regexp/regexp-parser.cc b/src/regexp/regexp-parser.cc |
index fd3123f674e3ca74986b945809cd7e439c09dc34..b8433f636a0b6be4fcf918fd155251e0f81466f6 100644 |
--- a/src/regexp/regexp-parser.cc |
+++ b/src/regexp/regexp-parser.cc |
@@ -1082,13 +1082,19 @@ bool IsExactPropertyValueAlias(const char* property_value_name, |
bool LookupPropertyValueName(UProperty property, |
const char* property_value_name, bool negate, |
ZoneList<CharacterRange>* result, Zone* zone) { |
+ UProperty property_for_lookup = property; |
+ if (property_for_lookup == UCHAR_SCRIPT_EXTENSIONS) { |
+ // For the property Script_Extensions, we have to do the property value |
+ // name lookup as if the property is Script. |
+ property_for_lookup = UCHAR_SCRIPT; |
+ } |
int32_t property_value = |
- u_getPropertyValueEnum(property, property_value_name); |
+ u_getPropertyValueEnum(property_for_lookup, property_value_name); |
if (property_value == UCHAR_INVALID_CODE) return false; |
// We require the property name to match exactly to one of the property value |
// aliases. However, u_getPropertyValueEnum uses loose matching. |
- if (!IsExactPropertyValueAlias(property_value_name, property, |
+ if (!IsExactPropertyValueAlias(property_value_name, property_for_lookup, |
property_value)) { |
return false; |
} |
@@ -1196,8 +1202,9 @@ bool RegExpParser::ParsePropertyClass(ZoneList<CharacterRange>* result, |
const char* property_name = first_part.ToConstVector().start(); |
const char* value_name = second_part.ToConstVector().start(); |
UProperty property = u_getPropertyEnum(property_name); |
- if (property < UCHAR_INT_START) return false; |
- if (property >= UCHAR_INT_LIMIT) return false; |
+ if (property != UCHAR_SCRIPT && property != UCHAR_SCRIPT_EXTENSIONS) { |
+ return false; |
+ } |
Dan Ehrenberg
2016/11/16 17:54:52
You're removing more than support for blocks here.
|
if (!IsExactPropertyAlias(property_name, property)) return false; |
return LookupPropertyValueName(property, value_name, negate, result, |
zone()); |