LibJS: Convert to_bigint_uint64() to ThrowCompletionOr
This commit is contained in:
parent
df181809fd
commit
51c33b3b35
Notes:
sideshowbarker
2024-07-18 02:17:26 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/51c33b3b35c Pull-request: https://github.com/SerenityOS/serenity/pull/10504 Reviewed-by: https://github.com/linusg
3 changed files with 4 additions and 4 deletions
|
@ -160,7 +160,7 @@ static ByteBuffer numeric_to_raw_bytes(GlobalObject& global_object, Value value,
|
|||
if constexpr (IsSigned<UnderlyingBufferDataType>)
|
||||
int_value = MUST(value.to_bigint_int64(global_object));
|
||||
else
|
||||
int_value = value.to_bigint_uint64(global_object);
|
||||
int_value = MUST(value.to_bigint_uint64(global_object));
|
||||
|
||||
ReadonlyBytes { &int_value, sizeof(UnderlyingBufferDataType) }.copy_to(raw_bytes);
|
||||
flip_if_needed();
|
||||
|
|
|
@ -553,9 +553,9 @@ ThrowCompletionOr<i64> Value::to_bigint_int64(GlobalObject& global_object) const
|
|||
}
|
||||
|
||||
// 7.1.16 ToBigUint64 ( argument ), https://tc39.es/ecma262/multipage/abstract-operations.html#sec-tobiguint64
|
||||
u64 Value::to_bigint_uint64(GlobalObject& global_object) const
|
||||
ThrowCompletionOr<u64> Value::to_bigint_uint64(GlobalObject& global_object) const
|
||||
{
|
||||
auto* bigint = TRY_OR_DISCARD(to_bigint(global_object));
|
||||
auto* bigint = TRY(to_bigint(global_object));
|
||||
return bigint->big_integer().to_u64();
|
||||
}
|
||||
|
||||
|
|
|
@ -312,7 +312,7 @@ public:
|
|||
Value to_number(GlobalObject&) const;
|
||||
ThrowCompletionOr<BigInt*> to_bigint(GlobalObject&) const;
|
||||
ThrowCompletionOr<i64> to_bigint_int64(GlobalObject&) const;
|
||||
u64 to_bigint_uint64(GlobalObject&) const;
|
||||
ThrowCompletionOr<u64> to_bigint_uint64(GlobalObject&) const;
|
||||
double to_double(GlobalObject&) const;
|
||||
StringOrSymbol to_property_key(GlobalObject&) const;
|
||||
i32 to_i32(GlobalObject& global_object) const
|
||||
|
|
Loading…
Add table
Reference in a new issue