1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 18:37:36 +00:00

LibJS: Remove the ConstrainToRange AO

This is an editorial change in the Temporal spec.

See: 537b3e6
This commit is contained in:
Linus Groh 2022-03-16 19:10:57 +00:00
parent 1521c5f55c
commit 2ad69d789b
5 changed files with 41 additions and 46 deletions

View file

@ -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.