mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibJS: Remove the ConstrainToRange AO
This is an editorial change in the Temporal spec.
See: 537b3e6
This commit is contained in:
parent
1521c5f55c
commit
2ad69d789b
Notes:
sideshowbarker
2024-07-17 17:16:40 +09:00
Author: https://github.com/linusg
Commit: 2ad69d789b
Pull-request: https://github.com/SerenityOS/serenity/pull/13081
Reviewed-by: https://github.com/IdanHo ✅
5 changed files with 41 additions and 46 deletions
|
@ -192,8 +192,8 @@ ISOYearMonth constrain_iso_year_month(double year, double month)
|
|||
// 1. Assert: year and month are integers.
|
||||
VERIFY(year == trunc(year) && month == trunc(month));
|
||||
|
||||
// 2. Set month to ! ConstrainToRange(month, 1, 12).
|
||||
month = constrain_to_range(month, 1, 12);
|
||||
// 2. Set month to the result of clamping month between 1 and 12.
|
||||
month = clamp(month, 1, 12);
|
||||
|
||||
// 3. Return the Record { [[Year]]: year, [[Month]]: month }.
|
||||
// NOTE: `year` is known to be in the i32 range.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue