mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 11:48:06 +00:00
LibCrypto+LibJS: Remove {Signed,Unsigned}BigInteger to_base_deprecated
Use `to_base` instead.
This commit is contained in:
parent
ac16008d09
commit
a019efb24b
Notes:
github-actions[bot]
2025-04-28 10:07:28 +00:00
Author: https://github.com/devgianlu
Commit: a019efb24b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4482
Reviewed-by: https://github.com/gmta ✅
8 changed files with 4 additions and 16 deletions
|
@ -27,7 +27,7 @@ public:
|
|||
Crypto::SignedBigInteger const& big_integer() const { return m_big_integer; }
|
||||
|
||||
ErrorOr<String> 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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -377,7 +377,7 @@ static i64 clip_bigint_to_sane_time(Crypto::SignedBigInteger const& value)
|
|||
return NumericLimits<i64>::max();
|
||||
|
||||
// FIXME: Can we do this without string conversion?
|
||||
return value.to_base_deprecated(10).to_number<i64>().value();
|
||||
return MUST(value.to_base(10)).to_number<i64>().value();
|
||||
}
|
||||
|
||||
static i64 clip_double_to_sane_time(double value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue