[regexp] Support Emoji_Component property class

This patch adds support for Emoji_Component within Unicode property
escapes in regular expressions.

The Emoji_Component binary property was added in Emoji data v5
and is supported in ICU 60.1.

An `#if` directive is used to prevent breaking Node.js until they
update their ICU.

BUG=v8:4743

Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: If1b49a4c175e88f1840ca5ef8d57829d6d8c3291
Reviewed-on: https://chromium-review.googlesource.com/758261
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49229}
This commit is contained in:
Mathias Bynens 2017-11-08 14:44:09 +01:00 committed by Commit Bot
parent d98ef522ac
commit 63536799ac
3 changed files with 5 additions and 8 deletions

View File

@ -1225,9 +1225,9 @@ bool IsSupportedBinaryProperty(UProperty property) {
case UCHAR_DEPRECATED:
case UCHAR_DIACRITIC:
case UCHAR_EMOJI:
// TODO(yangguo): Uncomment this once we upgrade to ICU 60.
// See https://ssl.icu-project.org/trac/ticket/13062
// case UCHAR_EMOJI_COMPONENT:
#if U_ICU_VERSION_MAJOR_NUM >= 60
case UCHAR_EMOJI_COMPONENT:
#endif
case UCHAR_EMOJI_MODIFIER_BASE:
case UCHAR_EMOJI_MODIFIER:
case UCHAR_EMOJI_PRESENTATION:

View File

@ -71,8 +71,8 @@ f(/\p{Dia}/u, "1");
t(/\p{Emoji}/u, "\u2603");
f(/\p{Emoji}/u, "x");
// t(/\p{Emoji_Component}/u, "\u2603");
// f(/\p{Emoji_Component}/u, "x");
t(/\p{Emoji_Component}/u, "\u{1F1E6}");
f(/\p{Emoji_Component}/u, "x");
t(/\p{Emoji_Modifier_Base}/u, "\u{1F6CC}");
f(/\p{Emoji_Modifier_Base}/u, "x");

View File

@ -438,9 +438,6 @@
'built-ins/Object/internals/DefineOwnProperty/consistent-value-function-caller': [FAIL_SLOPPY],
'built-ins/Object/internals/DefineOwnProperty/consistent-value-function-arguments': [FAIL_SLOPPY],
# https://bugs.chromium.org/p/v8/issues/detail?id=4743#c28
'built-ins/RegExp/property-escapes/generated/Emoji_Component': [FAIL],
# ICU 59 uses Unicode 9 data; property escape tests were generated for Unicode 10
'built-ins/RegExp/property-escapes/generated/*': [SKIP],