Skip to content

Commit

Permalink
LibJS: Verify valid Duraton is made in DifferenceTemporalPlainDate
Browse files Browse the repository at this point in the history
It shouldn't be possible to create an invalid duration here, so follow
the spec and verify that this succeeds.
  • Loading branch information
shannonbooth authored and trflynn89 committed Feb 16, 2024
1 parent bb8dad5 commit 4348b48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ ThrowCompletionOr<NonnullGCPtr<Duration>> 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));
}

}

0 comments on commit 4348b48

Please sign in to comment.