diff options
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs/v8-call-new-ListFormatter-createInstance.patch | 93 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_14.16.1.bb | 1 | 
2 files changed, 94 insertions, 0 deletions
| diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/v8-call-new-ListFormatter-createInstance.patch b/meta-oe/recipes-devtools/nodejs/nodejs/v8-call-new-ListFormatter-createInstance.patch new file mode 100644 index 0000000000..806360084c --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs/v8-call-new-ListFormatter-createInstance.patch | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | From 035c305ce7761f51328b45f1bd83e26aef267c9d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Frank Tang <ftang@chromium.org> | ||
| 3 | Date: Thu, 15 Oct 2020 22:44:27 -0700 | ||
| 4 | Subject: [PATCH] [Intl] call new ListFormatter::createInstance | ||
| 5 | |||
| 6 | The one we currently using is now marked as internal and to be removed | ||
| 7 | for 68. Migrating to the style which already avaiable in ICU 67-1. | ||
| 8 | |||
| 9 | Upstream-Status: Backport | ||
| 10 | Bug: v8:11031 | ||
| 11 | Change-Id: I668382a2e1b8602ddca02bf231c5008a6c92bf2d | ||
| 12 | Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2477751 | ||
| 13 | Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> | ||
| 14 | Commit-Queue: Frank Tang <ftang@chromium.org> | ||
| 15 | Cr-Commit-Position: refs/heads/master@{#70638} | ||
| 16 | --- | ||
| 17 | deps/v8/src/objects/js-list-format.cc | 55 ++++++++++++----------------------- | ||
| 18 | 1 file changed, 18 insertions(+), 37 deletions(-) | ||
| 19 | |||
| 20 | --- a/deps/v8/src/objects/js-list-format.cc | ||
| 21 | +++ b/deps/v8/src/objects/js-list-format.cc | ||
| 22 | @@ -29,46 +29,27 @@ namespace v8 { | ||
| 23 | namespace internal { | ||
| 24 | |||
| 25 | namespace { | ||
| 26 | -const char* kStandard = "standard"; | ||
| 27 | -const char* kOr = "or"; | ||
| 28 | -const char* kUnit = "unit"; | ||
| 29 | -const char* kStandardShort = "standard-short"; | ||
| 30 | -const char* kOrShort = "or-short"; | ||
| 31 | -const char* kUnitShort = "unit-short"; | ||
| 32 | -const char* kStandardNarrow = "standard-narrow"; | ||
| 33 | -const char* kOrNarrow = "or-narrow"; | ||
| 34 | -const char* kUnitNarrow = "unit-narrow"; | ||
| 35 | |||
| 36 | -const char* GetIcuStyleString(JSListFormat::Style style, | ||
| 37 | - JSListFormat::Type type) { | ||
| 38 | +UListFormatterWidth GetIcuWidth(JSListFormat::Style style) { | ||
| 39 | + switch (style) { | ||
| 40 | + case JSListFormat::Style::LONG: | ||
| 41 | + return ULISTFMT_WIDTH_WIDE; | ||
| 42 | + case JSListFormat::Style::SHORT: | ||
| 43 | + return ULISTFMT_WIDTH_SHORT; | ||
| 44 | + case JSListFormat::Style::NARROW: | ||
| 45 | + return ULISTFMT_WIDTH_NARROW; | ||
| 46 | + } | ||
| 47 | + UNREACHABLE(); | ||
| 48 | +} | ||
| 49 | + | ||
| 50 | +UListFormatterType GetIcuType(JSListFormat::Type type) { | ||
| 51 | switch (type) { | ||
| 52 | case JSListFormat::Type::CONJUNCTION: | ||
| 53 | - switch (style) { | ||
| 54 | - case JSListFormat::Style::LONG: | ||
| 55 | - return kStandard; | ||
| 56 | - case JSListFormat::Style::SHORT: | ||
| 57 | - return kStandardShort; | ||
| 58 | - case JSListFormat::Style::NARROW: | ||
| 59 | - return kStandardNarrow; | ||
| 60 | - } | ||
| 61 | + return ULISTFMT_TYPE_AND; | ||
| 62 | case JSListFormat::Type::DISJUNCTION: | ||
| 63 | - switch (style) { | ||
| 64 | - case JSListFormat::Style::LONG: | ||
| 65 | - return kOr; | ||
| 66 | - case JSListFormat::Style::SHORT: | ||
| 67 | - return kOrShort; | ||
| 68 | - case JSListFormat::Style::NARROW: | ||
| 69 | - return kOrNarrow; | ||
| 70 | - } | ||
| 71 | + return ULISTFMT_TYPE_OR; | ||
| 72 | case JSListFormat::Type::UNIT: | ||
| 73 | - switch (style) { | ||
| 74 | - case JSListFormat::Style::LONG: | ||
| 75 | - return kUnit; | ||
| 76 | - case JSListFormat::Style::SHORT: | ||
| 77 | - return kUnitShort; | ||
| 78 | - case JSListFormat::Style::NARROW: | ||
| 79 | - return kUnitNarrow; | ||
| 80 | - } | ||
| 81 | + return ULISTFMT_TYPE_UNITS; | ||
| 82 | } | ||
| 83 | UNREACHABLE(); | ||
| 84 | } | ||
| 85 | @@ -143,7 +124,7 @@ MaybeHandle<JSListFormat> JSListFormat:: | ||
| 86 | icu::Locale icu_locale = r.icu_locale; | ||
| 87 | UErrorCode status = U_ZERO_ERROR; | ||
| 88 | icu::ListFormatter* formatter = icu::ListFormatter::createInstance( | ||
| 89 | - icu_locale, GetIcuStyleString(style_enum, type_enum), status); | ||
| 90 | + icu_locale, GetIcuType(type_enum), GetIcuWidth(style_enum), status); | ||
| 91 | if (U_FAILURE(status) || formatter == nullptr) { | ||
| 92 | delete formatter; | ||
| 93 | THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError), | ||
| diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_14.16.1.bb b/meta-oe/recipes-devtools/nodejs/nodejs_14.16.1.bb index b24a6d6567..32bdd713b5 100644 --- a/meta-oe/recipes-devtools/nodejs/nodejs_14.16.1.bb +++ b/meta-oe/recipes-devtools/nodejs/nodejs_14.16.1.bb | |||
| @@ -21,6 +21,7 @@ SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ | |||
| 21 | file://0004-v8-don-t-override-ARM-CFLAGS.patch \ | 21 | file://0004-v8-don-t-override-ARM-CFLAGS.patch \ | 
| 22 | file://big-endian.patch \ | 22 | file://big-endian.patch \ | 
| 23 | file://mips-warnings.patch \ | 23 | file://mips-warnings.patch \ | 
| 24 | file://v8-call-new-ListFormatter-createInstance.patch \ | ||
| 24 | " | 25 | " | 
| 25 | SRC_URI_append_class-target = " \ | 26 | SRC_URI_append_class-target = " \ | 
| 26 | file://0002-Using-native-binaries.patch \ | 27 | file://0002-Using-native-binaries.patch \ | 
