1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +00:00

LibJS: Clarify mathematical types in Temporal AOs and functions

This is an editorial change in the Temporal spec.

See: e480d40
This commit is contained in:
Linus Groh 2021-10-26 23:10:11 +02:00
parent 30c39e0e41
commit 09d1db5afd
3 changed files with 26 additions and 19 deletions

View file

@ -618,6 +618,9 @@ String format_seconds_string_part(u8 second, u16 millisecond, u16 microsecond, u
// 13.29 ConstrainToRange ( x, minimum, maximum ), https://tc39.es/proposal-temporal/#sec-temporal-constraintorange
double constrain_to_range(double x, double minimum, double maximum)
{
// 1. Assert: x, minimum and maximum are mathematical values.
// 2. Return min(max(x, minimum), maximum).
return min(max(x, minimum), maximum);
}