diff --git a/Libraries/LibCrypto/BigFraction/BigFraction.cpp b/Libraries/LibCrypto/BigFraction/BigFraction.cpp index 971c7df56e7..0bf8025faf9 100644 --- a/Libraries/LibCrypto/BigFraction/BigFraction.cpp +++ b/Libraries/LibCrypto/BigFraction/BigFraction.cpp @@ -258,7 +258,7 @@ String BigFraction::to_string(unsigned rounding_threshold) const auto const rounded_fraction = rounded(rounding_threshold); // We take the unsigned value as we already manage the '-' - auto const full_value = rounded_fraction.m_numerator.unsigned_value().to_base_deprecated(10); + auto const full_value = MUST(rounded_fraction.m_numerator.unsigned_value().to_base(10)).to_byte_string(); int split = full_value.length() - (number_of_digits(rounded_fraction.m_denominator) - 1); if (split < 0) diff --git a/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp b/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp index 1edba05336a..ed4c120f517 100644 --- a/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp +++ b/Libraries/LibCrypto/BigInt/SignedBigInteger.cpp @@ -64,11 +64,6 @@ ErrorOr SignedBigInteger::to_base(u16 N) const return builder.to_string(); } -ByteString SignedBigInteger::to_base_deprecated(u16 N) const -{ - return MUST(to_base(N)).to_byte_string(); -} - u64 SignedBigInteger::to_u64() const { u64 unsigned_value = m_unsigned_data.to_u64(); diff --git a/Libraries/LibCrypto/BigInt/SignedBigInteger.h b/Libraries/LibCrypto/BigInt/SignedBigInteger.h index cb80d644953..3fdb7a43dea 100644 --- a/Libraries/LibCrypto/BigInt/SignedBigInteger.h +++ b/Libraries/LibCrypto/BigInt/SignedBigInteger.h @@ -59,7 +59,6 @@ public: [[nodiscard]] static ErrorOr from_base(u16 N, StringView str); [[nodiscard]] ErrorOr to_base(u16 N) const; - [[nodiscard]] ByteString to_base_deprecated(u16 N) const; [[nodiscard]] u64 to_u64() const; [[nodiscard]] double to_double(UnsignedBigInteger::RoundingMode rounding_mode = UnsignedBigInteger::RoundingMode::IEEERoundAndTiesToEvenMantissa) const; diff --git a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp index 62ed0f4df89..adfde479c34 100644 --- a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp +++ b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.cpp @@ -166,11 +166,6 @@ ErrorOr UnsignedBigInteger::to_base(u16 N) const return TRY(builder.to_string()).reverse(); } -ByteString UnsignedBigInteger::to_base_deprecated(u16 N) const -{ - return MUST(to_base(N)).to_byte_string(); -} - u64 UnsignedBigInteger::to_u64() const { static_assert(sizeof(Word) == 4); diff --git a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h index 79952aa83a0..30ecadd927a 100644 --- a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h +++ b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h @@ -65,7 +65,6 @@ public: [[nodiscard]] static ErrorOr from_base(u16 N, StringView str); [[nodiscard]] ErrorOr to_base(u16 N) const; - [[nodiscard]] ByteString to_base_deprecated(u16 N) const; [[nodiscard]] u64 to_u64() const; diff --git a/Libraries/LibJS/Runtime/BigInt.h b/Libraries/LibJS/Runtime/BigInt.h index 32fc97002b8..a4e3b09b638 100644 --- a/Libraries/LibJS/Runtime/BigInt.h +++ b/Libraries/LibJS/Runtime/BigInt.h @@ -27,7 +27,7 @@ public: Crypto::SignedBigInteger const& big_integer() const { return m_big_integer; } ErrorOr to_string() const; - ByteString to_byte_string() const { return ByteString::formatted("{}n", m_big_integer.to_base_deprecated(10)); } + ByteString to_byte_string() const { return ByteString::formatted("{}n", MUST(m_big_integer.to_base(10))); } private: explicit BigInt(Crypto::SignedBigInteger); diff --git a/Libraries/LibJS/Runtime/BigIntPrototype.cpp b/Libraries/LibJS/Runtime/BigIntPrototype.cpp index bf2073ec54e..2f910054ab9 100644 --- a/Libraries/LibJS/Runtime/BigIntPrototype.cpp +++ b/Libraries/LibJS/Runtime/BigIntPrototype.cpp @@ -74,7 +74,7 @@ JS_DEFINE_NATIVE_FUNCTION(BigIntPrototype::to_string) } // 5. Return BigInt::toString(x, radixMV). - return PrimitiveString::create(vm, bigint->big_integer().to_base_deprecated(radix)); + return PrimitiveString::create(vm, TRY_OR_THROW_OOM(vm, bigint->big_integer().to_base(radix))); } // 21.2.3.2 BigInt.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] ), https://tc39.es/ecma262/#sec-bigint.prototype.tolocalestring diff --git a/Libraries/LibJS/Runtime/Date.cpp b/Libraries/LibJS/Runtime/Date.cpp index df5065a0838..4f7f277814d 100644 --- a/Libraries/LibJS/Runtime/Date.cpp +++ b/Libraries/LibJS/Runtime/Date.cpp @@ -377,7 +377,7 @@ static i64 clip_bigint_to_sane_time(Crypto::SignedBigInteger const& value) return NumericLimits::max(); // FIXME: Can we do this without string conversion? - return value.to_base_deprecated(10).to_number().value(); + return MUST(value.to_base(10)).to_number().value(); } static i64 clip_double_to_sane_time(double value)