forked from pool/nodejs-electron
53 lines
2.1 KiB
Diff
53 lines
2.1 KiB
Diff
|
|
From 3ae42771de56d60148b2d70dd2793d6db9b43b71 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Frank Tang <ftang@chromium.org>
|
||
|
|
Date: Thu, 21 Apr 2022 10:26:54 -0700
|
||
|
|
Subject: [PATCH] [intl] Fix arm64-N5X failure in NumberFormat v3 due to
|
||
|
|
precision issue
|
||
|
|
|
||
|
|
Use the new ICU 71-1 API
|
||
|
|
|
||
|
|
Precision::incrementExact
|
||
|
|
https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/classicu_1_1number_1_1Precision.html#aedfb413e5a37c69868594c870a87134b
|
||
|
|
|
||
|
|
Change-Id: I6d8841e5a07972d1be36026ce150eb83dbf300e7
|
||
|
|
Cq-Include-Trybots: luci.v8.try:v8_android_arm64_n5x_rel_ng
|
||
|
|
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3430378
|
||
|
|
Reviewed-by: Shu-yu Guo <syg@chromium.org>
|
||
|
|
Commit-Queue: Frank Tang <ftang@chromium.org>
|
||
|
|
Cr-Commit-Position: refs/heads/main@{#80126}
|
||
|
|
---
|
||
|
|
src/objects/intl-objects.h | 2 +-
|
||
|
|
src/objects/js-number-format.cc | 5 ++---
|
||
|
|
test/test262/test262.status | 8 --------
|
||
|
|
3 files changed, 3 insertions(+), 12 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/src/objects/intl-objects.h b/src/objects/intl-objects.h
|
||
|
|
index 0541cd0ba5c..15e7e4d7fd3 100644
|
||
|
|
--- a/v8/src/objects/intl-objects.h
|
||
|
|
+++ b/v8/src/objects/intl-objects.h
|
||
|
|
@@ -21,7 +21,7 @@
|
||
|
|
#include "unicode/locid.h"
|
||
|
|
#include "unicode/uversion.h"
|
||
|
|
|
||
|
|
-#define V8_MINIMUM_ICU_VERSION 69
|
||
|
|
+#define V8_MINIMUM_ICU_VERSION 71
|
||
|
|
|
||
|
|
namespace U_ICU_NAMESPACE {
|
||
|
|
class BreakIterator;
|
||
|
|
diff --git a/src/objects/js-number-format.cc b/src/objects/js-number-format.cc
|
||
|
|
index ebfa5528a3a..633942aa2f7 100644
|
||
|
|
--- a/v8/src/objects/js-number-format.cc
|
||
|
|
+++ b/v8/src/objects/js-number-format.cc
|
||
|
|
@@ -884,9 +884,8 @@ icu::number::UnlocalizedNumberFormatter SetDigitOptionsToFormatterV3(
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
if (rounding_increment != 1) {
|
||
|
|
- double icu_increment = rounding_increment *
|
||
|
|
- std::pow(10, -digit_options.maximum_fraction_digits);
|
||
|
|
- precision = ::icu::number::Precision::increment(icu_increment)
|
||
|
|
+ precision = ::icu::number::Precision::incrementExact(
|
||
|
|
+ rounding_increment, -digit_options.maximum_fraction_digits)
|
||
|
|
.withMinFraction(digit_options.minimum_fraction_digits);
|
||
|
|
}
|
||
|
|
if (trailing_zeros == JSNumberFormat::ShowTrailingZeros::kHide) {
|