summaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-03-31 15:41:38 +0000
committerMoonchild <moonchild@palemoon.org>2021-03-31 15:41:38 +0000
commite07dee79c5daa6aebbf3014bcad822fa14fa7cfe (patch)
tree155bad3cd161ec6a054644c244424f3ad6d96b7a /js/src
parent685dafd7759e99afd09baa71dbe42f00543e28dc (diff)
downloaduxp-e07dee79c5daa6aebbf3014bcad822fa14fa7cfe.tar.gz
Issue #1756 - Clean up ICU patch.
We don't need ICU_UNUM_HAS_FORMATDOUBLEFORFIELDS because we don't support any ICU other than the one in-tree.
Diffstat (limited to 'js/src')
-rw-r--r--js/src/builtin/Intl.cpp26
1 files changed, 1 insertions, 25 deletions
diff --git a/js/src/builtin/Intl.cpp b/js/src/builtin/Intl.cpp
index 92dea5687e..5455b3a854 100644
--- a/js/src/builtin/Intl.cpp
+++ b/js/src/builtin/Intl.cpp
@@ -1202,23 +1202,11 @@ PartitionNumberPattern(JSContext* cx, UNumberFormat* nf, double* x,
MOZ_ALWAYS_TRUE(formattedChars.resize(INITIAL_CHAR_BUFFER_SIZE));
UErrorCode status = U_ZERO_ERROR;
-#if !defined(ICU_UNUM_HAS_FORMATDOUBLEFORFIELDS)
- MOZ_ASSERT(fpositer == nullptr,
- "shouldn't be requesting field information from an ICU that "
- "can't provide it");
-#endif
-
int32_t resultSize;
-#if defined(ICU_UNUM_HAS_FORMATDOUBLEFORFIELDS)
resultSize =
unum_formatDoubleForFields(nf, *x,
Char16ToUChar(formattedChars.begin()), INITIAL_CHAR_BUFFER_SIZE,
fpositer, &status);
-#else
- resultSize =
- unum_formatDouble(nf, *x, Char16ToUChar(formattedChars.begin()), INITIAL_CHAR_BUFFER_SIZE,
- nullptr, &status);
-#endif // defined(ICU_UNUM_HAS_FORMATDOUBLEFORFIELDS)
if (status == U_BUFFER_OVERFLOW_ERROR) {
if (!formattedChars.resize(size_t(resultSize)))
return false;
@@ -1226,13 +1214,8 @@ PartitionNumberPattern(JSContext* cx, UNumberFormat* nf, double* x,
#ifdef DEBUG
int32_t size =
#endif
-#if defined(ICU_UNUM_HAS_FORMATDOUBLEFORFIELDS)
unum_formatDoubleForFields(nf, *x, Char16ToUChar(formattedChars.begin()), resultSize,
fpositer, &status);
-#else
- unum_formatDouble(nf, *x, Char16ToUChar(formattedChars.begin()), resultSize,
- nullptr, &status);
-#endif // defined(ICU_UNUM_HAS_FORMATDOUBLEFORFIELDS)
MOZ_ASSERT(size == resultSize);
}
if (U_FAILURE(status)) {
@@ -1262,8 +1245,6 @@ intl_FormatNumber(JSContext* cx, UNumberFormat* nf, double x, MutableHandleValue
using FieldType = ImmutablePropertyNamePtr JSAtomState::*;
-#if defined(ICU_UNUM_HAS_FORMATDOUBLEFORFIELDS)
-
static FieldType
GetFieldTypeForNumberField(UNumberFormatFields fieldName, double d)
{
@@ -1658,8 +1639,6 @@ intl_FormatNumberToParts(JSContext* cx, UNumberFormat* nf, double x, MutableHand
return true;
}
-#endif // defined(ICU_UNUM_HAS_FORMATDOUBLEFORFIELDS)
-
bool
js::intl_FormatNumber(JSContext* cx, unsigned argc, Value* vp)
{
@@ -1699,12 +1678,9 @@ js::intl_FormatNumber(JSContext* cx, unsigned argc, Value* vp)
RootedValue result(cx);
bool success;
-#if defined(ICU_UNUM_HAS_FORMATDOUBLEFORFIELDS)
if (args[2].toBoolean()) {
success = intl_FormatNumberToParts(cx, nf, d, &result);
- } else
-#endif // defined(ICU_UNUM_HAS_FORMATDOUBLEFORFIELDS)
- {
+ } else {
MOZ_ASSERT(!args[2].toBoolean(),
"shouldn't be doing formatToParts without an ICU that "
"supports it");