1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

LibJS: Replace "is not zero" language in Temporal comments

This commit ticks away one of the boxes in #15525
Temporal commit: tc39/proposal-temporal@9cd448a
This commit is contained in:
BodilessSleeper 2023-01-06 02:35:12 +01:00 committed by Linus Groh
parent 3d87445c82
commit 18122c0368
2 changed files with 10 additions and 10 deletions

View file

@ -309,7 +309,7 @@ ThrowCompletionOr<u64> to_temporal_rounding_increment(VM& vm, Object const& norm
// 7. Set increment to floor((increment)).
auto floored_increment = static_cast<u64>(increment);
// 8. If dividend is not undefined and dividend modulo increment is not zero, then
// 8. If dividend is not undefined and dividend modulo increment ≠ 0, then
if (dividend.has_value() && static_cast<u64>(*dividend) % floored_increment != 0)
// a. Throw a RangeError exception.
return vm.throw_completion<RangeError>(ErrorType::OptionIsNotValidValue, increment, "roundingIncrement");

View file

@ -259,39 +259,39 @@ bool is_valid_duration(double years, double months, double weeks, double days, d
// 7.5.12 DefaultTemporalLargestUnit ( years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds ), https://tc39.es/proposal-temporal/#sec-temporal-defaulttemporallargestunit
StringView default_temporal_largest_unit(double years, double months, double weeks, double days, double hours, double minutes, double seconds, double milliseconds, double microseconds)
{
// 1. If years is not zero, return "year".
// 1. If years ≠ 0, return "year".
if (years != 0)
return "year"sv;
// 2. If months is not zero, return "month".
// 2. If months ≠ 0, return "month".
if (months != 0)
return "month"sv;
// 3. If weeks is not zero, return "week".
// 3. If weeks ≠ 0, return "week".
if (weeks != 0)
return "week"sv;
// 4. If days is not zero, return "day".
// 4. If days ≠ 0, return "day".
if (days != 0)
return "day"sv;
// 5. If hours is not zero, return "hour".
// 5. If hours ≠ 0, return "hour".
if (hours != 0)
return "hour"sv;
// 6. If minutes is not zero, return "minute".
// 6. If minutes ≠ 0, return "minute".
if (minutes != 0)
return "minute"sv;
// 7. If seconds is not zero, return "second".
// 7. If seconds ≠ 0, return "second".
if (seconds != 0)
return "second"sv;
// 8. If milliseconds is not zero, return "millisecond".
// 8. If milliseconds ≠ 0, return "millisecond".
if (milliseconds != 0)
return "millisecond"sv;
// 9. If microseconds is not zero, return "microsecond".
// 9. If microseconds ≠ 0, return "microsecond".
if (microseconds != 0)
return "microsecond"sv;