From 7bacf2c3143bd54ffa8489b647f9e5bd3d2ca888 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Fri, 23 Apr 2021 04:00:37 +0100 Subject: [PATCH] node@12: add patch for ICU 69 This is a backport of https://github.com/v8/v8/commit/035c305ce7761f51328b45f1bd83e26aef267c9d. --- node@12/node@12-icu69.patch | 90 +++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 node@12/node@12-icu69.patch diff --git a/node@12/node@12-icu69.patch b/node@12/node@12-icu69.patch new file mode 100644 index 00000000..518ff583 --- /dev/null +++ b/node@12/node@12-icu69.patch @@ -0,0 +1,90 @@ +From c886926d9fa59e681bbbe46ef7a84079239300f2 Mon Sep 17 00:00:00 2001 +From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> +Date: Fri, 23 Apr 2021 03:52:02 +0100 +Subject: [PATCH] Backport v8 patch for ICU 69 + +This is a backport of https://github.com/v8/v8/commit/035c305ce7761f51328b45f1bd83e26aef267c9d. +--- + deps/v8/src/objects/js-list-format.cc | 55 +++++++++------------------ + 1 file changed, 18 insertions(+), 37 deletions(-) + +diff --git a/deps/v8/src/objects/js-list-format.cc b/deps/v8/src/objects/js-list-format.cc +index 4f303b18..982e9a31 100644 +--- a/deps/v8/src/objects/js-list-format.cc ++++ b/deps/v8/src/objects/js-list-format.cc +@@ -29,46 +29,27 @@ namespace v8 { + namespace internal { + + namespace { +-const char* kStandard = "standard"; +-const char* kOr = "or"; +-const char* kUnit = "unit"; +-const char* kStandardShort = "standard-short"; +-const char* kOrShort = "or-short"; +-const char* kUnitShort = "unit-short"; +-const char* kStandardNarrow = "standard-narrow"; +-const char* kOrNarrow = "or-narrow"; +-const char* kUnitNarrow = "unit-narrow"; +- +-const char* GetIcuStyleString(JSListFormat::Style style, +- JSListFormat::Type type) { ++ ++UListFormatterWidth GetIcuWidth(JSListFormat::Style style) { ++ switch (style) { ++ case JSListFormat::Style::LONG: ++ return ULISTFMT_WIDTH_WIDE; ++ case JSListFormat::Style::SHORT: ++ return ULISTFMT_WIDTH_SHORT; ++ case JSListFormat::Style::NARROW: ++ return ULISTFMT_WIDTH_NARROW; ++ } ++ UNREACHABLE(); ++} ++ ++UListFormatterType GetIcuType(JSListFormat::Type type) { + switch (type) { + case JSListFormat::Type::CONJUNCTION: +- switch (style) { +- case JSListFormat::Style::LONG: +- return kStandard; +- case JSListFormat::Style::SHORT: +- return kStandardShort; +- case JSListFormat::Style::NARROW: +- return kStandardNarrow; +- } ++ return ULISTFMT_TYPE_AND; + case JSListFormat::Type::DISJUNCTION: +- switch (style) { +- case JSListFormat::Style::LONG: +- return kOr; +- case JSListFormat::Style::SHORT: +- return kOrShort; +- case JSListFormat::Style::NARROW: +- return kOrNarrow; +- } ++ return ULISTFMT_TYPE_OR; + case JSListFormat::Type::UNIT: +- switch (style) { +- case JSListFormat::Style::LONG: +- return kUnit; +- case JSListFormat::Style::SHORT: +- return kUnitShort; +- case JSListFormat::Style::NARROW: +- return kUnitNarrow; +- } ++ return ULISTFMT_TYPE_UNITS; + } + UNREACHABLE(); + } +@@ -170,7 +151,7 @@ MaybeHandle JSListFormat::New(Isolate* isolate, Handle map, + icu::Locale icu_locale = r.icu_locale; + UErrorCode status = U_ZERO_ERROR; + icu::ListFormatter* formatter = icu::ListFormatter::createInstance( +- icu_locale, GetIcuStyleString(style_enum, type_enum), status); ++ icu_locale, GetIcuType(type_enum), GetIcuWidth(style_enum), status); + if (U_FAILURE(status)) { + delete formatter; + FATAL("Failed to create ICU list formatter, are ICU data files missing?"); +-- +2.31.1 +