1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

LibJS: Convert to_bigint_int64() to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-16 21:56:14 +03:00 committed by Linus Groh
parent e87cea8248
commit df181809fd
4 changed files with 6 additions and 5 deletions

View file

@ -546,9 +546,9 @@ ThrowCompletionOr<BigInt*> Value::to_bigint(GlobalObject& global_object) const
}
// 7.1.15 ToBigInt64 ( argument ), https://tc39.es/ecma262/multipage/abstract-operations.html#sec-tobigint64
i64 Value::to_bigint_int64(GlobalObject& global_object) const
ThrowCompletionOr<i64> Value::to_bigint_int64(GlobalObject& global_object) const
{
auto* bigint = TRY_OR_DISCARD(to_bigint(global_object));
auto* bigint = TRY(to_bigint(global_object));
return static_cast<i64>(bigint->big_integer().to_u64());
}