summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-09-16 22:07:14 +0100
committerLinus Groh <mail@linusgroh.de>2021-09-17 08:25:12 +0100
commitea7cc70118e1f16d2897d2851198345a0a93627d (patch)
tree0725e23f50c63ec2473c09ec8b0aff08b7ede450 /Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp
parentf8d92232c88a659a871e7cb498270c13c6a1524f (diff)
downloadserenity-ea7cc70118e1f16d2897d2851198345a0a93627d.zip
LibJS: Convert Duration AOs to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp
index 83cf7a9364..2a69dada37 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp
@@ -81,7 +81,7 @@ Value DurationConstructor::construct(FunctionObject& new_target)
auto ns = TRY_OR_DISCARD(to_integer_throw_on_infinity(global_object, vm.argument(9), ErrorType::TemporalInvalidDuration));
// 12. Return ? CreateTemporalDuration(y, mo, w, d, h, m, s, ms, mis, ns, NewTarget).
- return create_temporal_duration(global_object, y, mo, w, d, h, m, s, ms, mis, ns, &new_target);
+ return TRY_OR_DISCARD(create_temporal_duration(global_object, y, mo, w, d, h, m, s, ms, mis, ns, &new_target));
}
// 7.2.2 Temporal.Duration.from ( item ), https://tc39.es/proposal-temporal/#sec-temporal.duration.from
@@ -94,11 +94,11 @@ JS_DEFINE_NATIVE_FUNCTION(DurationConstructor::from)
auto& duration = static_cast<Duration&>(item.as_object());
// a. Return ? CreateTemporalDuration(item.[[Years]], item.[[Months]], item.[[Weeks]], item.[[Days]], item.[[Hours]], item.[[Minutes]], item.[[Seconds]], item.[[Milliseconds]], item.[[Microseconds]], item.[[Nanoseconds]]).
- return create_temporal_duration(global_object, duration.years(), duration.months(), duration.weeks(), duration.days(), duration.hours(), duration.minutes(), duration.seconds(), duration.milliseconds(), duration.microseconds(), duration.nanoseconds());
+ return TRY_OR_DISCARD(create_temporal_duration(global_object, duration.years(), duration.months(), duration.weeks(), duration.days(), duration.hours(), duration.minutes(), duration.seconds(), duration.milliseconds(), duration.microseconds(), duration.nanoseconds()));
}
// 2. Return ? ToTemporalDuration(item).
- return to_temporal_duration(global_object, item);
+ return TRY_OR_DISCARD(to_temporal_duration(global_object, item));
}
}