From 2c9482750858aefc9559deb0af870ee9347124ea Mon Sep 17 00:00:00 2001 From: Noah Huppert Date: Sat, 8 Aug 2020 00:46:01 -0400 Subject: [PATCH] [ci skip] nodejs: update to 14.5.0 --- .../patches/0092-getAllFieldPositions.patch | 169 ------------------ srcpkgs/nodejs/patches/ppc32.patch | 20 --- srcpkgs/nodejs/template | 6 +- 3 files changed, 3 insertions(+), 192 deletions(-) delete mode 100644 srcpkgs/nodejs/patches/0092-getAllFieldPositions.patch delete mode 100644 srcpkgs/nodejs/patches/ppc32.patch diff --git a/srcpkgs/nodejs/patches/0092-getAllFieldPositions.patch b/srcpkgs/nodejs/patches/0092-getAllFieldPositions.patch deleted file mode 100644 index f9d3718949b..00000000000 --- a/srcpkgs/nodejs/patches/0092-getAllFieldPositions.patch +++ /dev/null @@ -1,169 +0,0 @@ -From 2b107e7670ffb43719a66ee4a55ab408a5dcf2a5 Mon Sep 17 00:00:00 2001 -From: Ujjwal Sharma -Date: Wed, 22 Apr 2020 12:20:17 +0530 -Subject: [PATCH] deps: V8: backport 3f8dc4b2e5ba - -Original commit message: - - [intl] Remove soon-to-be removed getAllFieldPositions - - Needed to land ICU67.1 soon. - - Bug: v8:10393 - Change-Id: I3c7737ca600d6ccfdc46ffaddfb318ce60bc7618 - Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2136489 - Reviewed-by: Jakob Kummerow - Commit-Queue: Frank Tang - Cr-Commit-Position: refs/heads/master@{#67027} - -Refs: https://github.com/v8/v8/commit/3f8dc4b2e5baf77b463334c769af85b79d8c1463 ---- - common.gypi | 2 +- - deps/v8/src/objects/js-number-format.cc | 72 +++++++++++++------------ - 2 files changed, 38 insertions(+), 36 deletions(-) - -diff --git a/src/3rdparty/chromium/v8/src/objects/js-number-format.cc b/src/3rdparty/chromium/v8/src/objects/js-number-format.cc -index 92d3e2fb82e..ced408aa173 100644 ---- deps/v8/src/objects/js-number-format.cc -+++ deps/v8/src/objects/js-number-format.cc -@@ -1197,42 +1197,31 @@ MaybeHandle JSNumberFormat::New(Isolate* isolate, - } - - namespace { --Maybe IcuFormatNumber( -+Maybe IcuFormatNumber( - Isolate* isolate, - const icu::number::LocalizedNumberFormatter& number_format, -- Handle numeric_obj, icu::FieldPositionIterator* fp_iter) { -+ Handle numeric_obj, icu::number::FormattedNumber* formatted) { - // If it is BigInt, handle it differently. - UErrorCode status = U_ZERO_ERROR; -- icu::number::FormattedNumber formatted; - if (numeric_obj->IsBigInt()) { - Handle big_int = Handle::cast(numeric_obj); - Handle big_int_string; - ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, big_int_string, - BigInt::ToString(isolate, big_int), -- Nothing()); -- formatted = number_format.formatDecimal( -+ Nothing()); -+ *formatted = number_format.formatDecimal( - {big_int_string->ToCString().get(), big_int_string->length()}, status); - } else { - double number = numeric_obj->Number(); -- formatted = number_format.formatDouble(number, status); -+ *formatted = number_format.formatDouble(number, status); - } - if (U_FAILURE(status)) { - // This happen because of icu data trimming trim out "unit". - // See https://bugs.chromium.org/p/v8/issues/detail?id=8641 -- THROW_NEW_ERROR_RETURN_VALUE(isolate, -- NewTypeError(MessageTemplate::kIcuError), -- Nothing()); -- } -- if (fp_iter) { -- formatted.getAllFieldPositions(*fp_iter, status); -+ THROW_NEW_ERROR_RETURN_VALUE( -+ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing()); - } -- icu::UnicodeString result = formatted.toString(status); -- if (U_FAILURE(status)) { -- THROW_NEW_ERROR_RETURN_VALUE(isolate, -- NewTypeError(MessageTemplate::kIcuError), -- Nothing()); -- } -- return Just(result); -+ return Just(true); - } - - } // namespace -@@ -1243,10 +1232,16 @@ MaybeHandle JSNumberFormat::FormatNumeric( - Handle numeric_obj) { - DCHECK(numeric_obj->IsNumeric()); - -- Maybe maybe_format = -- IcuFormatNumber(isolate, number_format, numeric_obj, nullptr); -+ icu::number::FormattedNumber formatted; -+ Maybe maybe_format = -+ IcuFormatNumber(isolate, number_format, numeric_obj, &formatted); - MAYBE_RETURN(maybe_format, Handle()); -- return Intl::ToString(isolate, maybe_format.FromJust()); -+ UErrorCode status = U_ZERO_ERROR; -+ icu::UnicodeString result = formatted.toString(status); -+ if (U_FAILURE(status)) { -+ THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError), String); -+ } -+ return Intl::ToString(isolate, result); - } - - namespace { -@@ -1359,12 +1354,18 @@ std::vector FlattenRegionsToParts( - } - - namespace { --Maybe ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted, -- icu::FieldPositionIterator* fp_iter, -+Maybe ConstructParts(Isolate* isolate, -+ icu::number::FormattedNumber* formatted, - Handle result, int start_index, - Handle numeric_obj, bool style_is_unit) { -+ UErrorCode status = U_ZERO_ERROR; -+ icu::UnicodeString formatted_text = formatted->toString(status); -+ if (U_FAILURE(status)) { -+ THROW_NEW_ERROR_RETURN_VALUE( -+ isolate, NewTypeError(MessageTemplate::kIcuError), Nothing()); -+ } - DCHECK(numeric_obj->IsNumeric()); -- int32_t length = formatted.length(); -+ int32_t length = formatted_text.length(); - int index = start_index; - if (length == 0) return Just(index); - -@@ -1373,13 +1374,14 @@ Maybe ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted, - // other region covers some part of the formatted string. It's possible - // there's another field with exactly the same begin and end as this backdrop, - // in which case the backdrop's field_id of -1 will give it lower priority. -- regions.push_back(NumberFormatSpan(-1, 0, formatted.length())); -+ regions.push_back(NumberFormatSpan(-1, 0, formatted_text.length())); - - { -- icu::FieldPosition fp; -- while (fp_iter->next(fp)) { -- regions.push_back(NumberFormatSpan(fp.getField(), fp.getBeginIndex(), -- fp.getEndIndex())); -+ icu::ConstrainedFieldPosition cfp; -+ cfp.constrainCategory(UFIELD_CATEGORY_NUMBER); -+ while (formatted->nextPosition(cfp, status)) { -+ regions.push_back( -+ NumberFormatSpan(cfp.getField(), cfp.getStart(), cfp.getLimit())); - } - } - -@@ -1401,7 +1403,7 @@ Maybe ConstructParts(Isolate* isolate, const icu::UnicodeString& formatted, - Handle substring; - ASSIGN_RETURN_ON_EXCEPTION_VALUE( - isolate, substring, -- Intl::ToString(isolate, formatted, part.begin_pos, part.end_pos), -+ Intl::ToString(isolate, formatted_text, part.begin_pos, part.end_pos), - Nothing()); - Intl::AddElement(isolate, result, index, field_type_string, substring); - ++index; -@@ -1421,14 +1423,14 @@ MaybeHandle JSNumberFormat::FormatToParts( - number_format->icu_number_formatter().raw(); - CHECK_NOT_NULL(fmt); - -- icu::FieldPositionIterator fp_iter; -- Maybe maybe_format = -- IcuFormatNumber(isolate, *fmt, numeric_obj, &fp_iter); -+ icu::number::FormattedNumber formatted; -+ Maybe maybe_format = -+ IcuFormatNumber(isolate, *fmt, numeric_obj, &formatted); - MAYBE_RETURN(maybe_format, Handle()); - - Handle result = factory->NewJSArray(0); - Maybe maybe_format_to_parts = ConstructParts( -- isolate, maybe_format.FromJust(), &fp_iter, result, 0, numeric_obj, -+ isolate, &formatted, result, 0, numeric_obj, - number_format->style() == JSNumberFormat::Style::UNIT); - MAYBE_RETURN(maybe_format_to_parts, Handle()); - diff --git a/srcpkgs/nodejs/patches/ppc32.patch b/srcpkgs/nodejs/patches/ppc32.patch deleted file mode 100644 index 502d471429f..00000000000 --- a/srcpkgs/nodejs/patches/ppc32.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- deps/v8/src/libsampler/sampler.cc.orig -+++ deps/v8/src/libsampler/sampler.cc -@@ -423,10 +423,17 @@ - state->lr = reinterpret_cast(ucontext->uc_mcontext.regs->link); - #else - // Some C libraries, notably Musl, define the regs member as a void pointer -+ #if !V8_TARGET_ARCH_32_BIT - state->pc = reinterpret_cast(ucontext->uc_mcontext.gp_regs[32]); - state->sp = reinterpret_cast(ucontext->uc_mcontext.gp_regs[1]); - state->fp = reinterpret_cast(ucontext->uc_mcontext.gp_regs[31]); - state->lr = reinterpret_cast(ucontext->uc_mcontext.gp_regs[36]); -+ #else -+ state->pc = reinterpret_cast(ucontext->uc_mcontext.gregs[32]); -+ state->sp = reinterpret_cast(ucontext->uc_mcontext.gregs[1]); -+ state->fp = reinterpret_cast(ucontext->uc_mcontext.gregs[31]); -+ state->lr = reinterpret_cast(ucontext->uc_mcontext.gregs[36]); -+ #endif - #endif - #elif V8_HOST_ARCH_S390 - #if V8_TARGET_ARCH_32_BIT diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template index c7dc1281b8a..528838e9ee3 100644 --- a/srcpkgs/nodejs/template +++ b/srcpkgs/nodejs/template @@ -1,7 +1,7 @@ # Template file for 'nodejs' pkgname=nodejs -version=13.2.0 -revision=3 +version=14.5.0 +revision=1 wrksrc="node-v${version}" # Need these for host v8 for torque, see https://github.com/nodejs/node/pull/21079 hostmakedepends="which pkg-config python3 zlib-devel $(vopt_if icu icu-devel) @@ -17,7 +17,7 @@ maintainer="Enno Boland " license="MIT" homepage="https://nodejs.org/" distfiles="${homepage}/dist/v${version}/node-v${version}.tar.gz" -checksum=379dcecb721984a99dc9e16c2a096d6eb7a760d50b188582d9ce33e0478a1a5e +checksum=6de72f993f3c6b852cfd2cee6cbc09ab52f2d96145ec919b6d2ad0747ea8c3ae python_version=3 build_options="ssl libuv http_parser icu nghttp2 cares"