mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:37:35 +00:00
LibJS: Convert to_temporal_overflow() to ThrowCompletionOr
This commit is contained in:
parent
b1e7e62657
commit
9f03647f1f
13 changed files with 26 additions and 53 deletions
|
@ -88,9 +88,7 @@ JS_DEFINE_NATIVE_FUNCTION(PlainTimeConstructor::from)
|
|||
auto* options = TRY_OR_DISCARD(get_options_object(global_object, vm.argument(1)));
|
||||
|
||||
// 2. Let overflow be ? ToTemporalOverflow(options).
|
||||
auto overflow = to_temporal_overflow(global_object, *options);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto overflow = TRY_OR_DISCARD(to_temporal_overflow(global_object, *options));
|
||||
|
||||
auto item = vm.argument(0);
|
||||
|
||||
|
@ -102,7 +100,7 @@ JS_DEFINE_NATIVE_FUNCTION(PlainTimeConstructor::from)
|
|||
}
|
||||
|
||||
// 4. Return ? ToTemporalTime(item, overflow).
|
||||
return TRY_OR_DISCARD(to_temporal_time(global_object, item, *overflow));
|
||||
return TRY_OR_DISCARD(to_temporal_time(global_object, item, overflow));
|
||||
}
|
||||
|
||||
// 4.2.3 Temporal.PlainTime.compare ( one, two ), https://tc39.es/proposal-temporal/#sec-temporal.plaintime.compare
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue