mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
LibJS: Clarify mathematical types in Temporal AOs and functions
This is an editorial change in the Temporal spec. See: https://github.com/tc39/proposal-temporal/commit/e480d40
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 01:51:38 +09:00
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user