From 4348b484c60e9c9009de1c61c5e62871a5581fac Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Fri, 16 Feb 2024 21:11:57 +1300 Subject: [PATCH] LibJS: Verify valid Duraton is made in DifferenceTemporalPlainDate It shouldn't be possible to create an invalid duration here, so follow the spec and verify that this succeeds. --- Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp index dafc42de4f..51089649ab 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp @@ -577,7 +577,7 @@ ThrowCompletionOr> difference_temporal_plain_date(VM& vm, } // 16. Return ! CreateTemporalDuration(sign × result.[[Years]], sign × result.[[Months]], sign × result.[[Weeks]], sign × result.[[Days]], 0, 0, 0, 0, 0, 0). - return TRY(create_temporal_duration(vm, sign * result->years(), sign * result->months(), sign * result->weeks(), sign * result->days(), 0, 0, 0, 0, 0, 0)); + return MUST(create_temporal_duration(vm, sign * result->years(), sign * result->months(), sign * result->weeks(), sign * result->days(), 0, 0, 0, 0, 0, 0)); } }