1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

LibJS: Convert to_temporal_overflow() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-09-15 23:39:42 +01:00
parent b1e7e62657
commit 9f03647f1f
13 changed files with 26 additions and 53 deletions

View file

@ -110,9 +110,7 @@ JS_DEFINE_NATIVE_FUNCTION(PlainDateTimeConstructor::from)
auto& plain_date_time = static_cast<PlainDateTime&>(item.as_object());
// a. Perform ? ToTemporalOverflow(options).
(void)to_temporal_overflow(global_object, *options);
if (vm.exception())
return {};
(void)TRY_OR_DISCARD(to_temporal_overflow(global_object, *options));
// b. Return ? CreateTemporalDateTime(item.[[ISOYear]], item.[[ISOMonth]], item.[[ISODay]], item.[[ISOHour]], item.[[ISOMinute]], item.[[ISOSecond]], item.[[ISOMillisecond]], item.[[ISOMicrosecond]], item.[[ISONanosecond]], item.[[Calendar]]).
return create_temporal_date_time(global_object, plain_date_time.iso_year(), plain_date_time.iso_month(), plain_date_time.iso_day(), plain_date_time.iso_hour(), plain_date_time.iso_minute(), plain_date_time.iso_second(), plain_date_time.iso_millisecond(), plain_date_time.iso_microsecond(), plain_date_time.iso_nanosecond(), plain_date_time.calendar());