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
commit 09d1db5afd
Notes: sideshowbarker 2024-07-18 01:51:38 +09:00
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);
}