mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +00:00
LibJS: Convert to_bigint() to ThrowCompletionOr
This commit is contained in:
parent
b8f101888b
commit
e87cea8248
10 changed files with 27 additions and 56 deletions
|
@ -49,9 +49,7 @@ Value ZonedDateTimeConstructor::construct(FunctionObject& new_target)
|
|||
auto& global_object = this->global_object();
|
||||
|
||||
// 2. Set epochNanoseconds to ? ToBigInt(epochNanoseconds).
|
||||
auto* epoch_nanoseconds = vm.argument(0).to_bigint(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto* epoch_nanoseconds = TRY_OR_DISCARD(vm.argument(0).to_bigint(global_object));
|
||||
|
||||
// 3. If ! IsValidEpochNanoseconds(epochNanoseconds) is false, throw a RangeError exception.
|
||||
if (!is_valid_epoch_nanoseconds(*epoch_nanoseconds)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue