mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
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.
This commit is contained in:
parent
bb8dad5bb0
commit
4348b484c6
Notes:
sideshowbarker
2024-07-17 02:06:40 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/4348b484c6 Pull-request: https://github.com/SerenityOS/serenity/pull/23145 Reviewed-by: https://github.com/trflynn89 ✅
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user