diff options
author | Linus Groh <mail@linusgroh.de> | 2022-03-10 17:04:46 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-03-10 23:20:39 +0100 |
commit | 17da627b4ccc440e7e6527dc1e70ea745a567390 (patch) | |
tree | 39e715a8eaf57303f9d56f23db0ee264e34eb86a /Userland/Libraries/LibJS/Runtime/Temporal | |
parent | 4722045e28777aacc33c5549b4839343d95ec1e7 (diff) | |
download | serenity-17da627b4ccc440e7e6527dc1e70ea745a567390.zip |
LibJS: Fix "set it to" language to be more explicit
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/de58241
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Temporal')
9 files changed, 16 insertions, 16 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp index c64304d089..208734aae7 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp @@ -334,7 +334,7 @@ ThrowCompletionOr<Duration*> create_temporal_duration(GlobalObject& global_objec if (!is_valid_duration(years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds)) return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidDuration); - // 2. If newTarget is not present, set it to %Temporal.Duration%. + // 2. If newTarget is not present, set newTarget to %Temporal.Duration%. if (!new_target) new_target = global_object.temporal_duration_constructor(); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp index c2887af154..0ae6b23cf5 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp @@ -57,7 +57,7 @@ ThrowCompletionOr<Instant*> create_temporal_instant(GlobalObject& global_object, // 2. Assert: ! IsValidEpochNanoseconds(epochNanoseconds) is true. VERIFY(is_valid_epoch_nanoseconds(epoch_nanoseconds)); - // 3. If newTarget is not present, set it to %Temporal.Instant%. + // 3. If newTarget is not present, set newTarget to %Temporal.Instant%. if (!new_target) new_target = global_object.temporal_instant_constructor(); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp index 7ee48d2d96..4fec74c335 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp @@ -54,7 +54,7 @@ ThrowCompletionOr<PlainDate*> create_temporal_date(GlobalObject& global_object, if (!iso_date_time_within_limits(global_object, iso_year, iso_month, iso_day, 12, 0, 0, 0, 0, 0)) return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidPlainDate); - // 7. If newTarget is not present, set it to %Temporal.PlainDate%. + // 7. If newTarget is not present, set newTarget to %Temporal.PlainDate%. if (!new_target) new_target = global_object.temporal_plain_date_constructor(); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp index ec5e5650dc..d394fe623a 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp @@ -249,7 +249,7 @@ ThrowCompletionOr<PlainDateTime*> create_temporal_date_time(GlobalObject& global return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidPlainDateTime); } - // 6. If newTarget is not present, set it to %Temporal.PlainDateTime%. + // 6. If newTarget is not present, set newTarget to %Temporal.PlainDateTime%. if (!new_target) new_target = global_object.temporal_plain_date_time_constructor(); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp index 1026860607..d3311a5f7c 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Linus Groh <linusg@serenityos.org> + * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org> * Copyright (c) 2021, Luke Wilde <lukew@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause @@ -158,7 +158,7 @@ ThrowCompletionOr<PlainMonthDay*> create_temporal_month_day(GlobalObject& global if (!is_valid_iso_date(reference_iso_year, iso_month, iso_day)) return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidPlainMonthDay); - // 4. If newTarget is not present, set it to %Temporal.PlainMonthDay%. + // 4. If newTarget is not present, set newTarget to %Temporal.PlainMonthDay%. if (!new_target) new_target = global_object.temporal_plain_month_day_constructor(); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp index a2df8e07d5..a4c4a76377 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp @@ -75,7 +75,7 @@ ThrowCompletionOr<PlainTime*> to_temporal_time(GlobalObject& global_object, Valu { auto& vm = global_object.vm(); - // 1. If overflow is not present, set it to "constrain". + // 1. If overflow is not present, set overflow to "constrain". if (!overflow.has_value()) overflow = "constrain"sv; @@ -361,7 +361,7 @@ ThrowCompletionOr<PlainTime*> create_temporal_time(GlobalObject& global_object, if (!is_valid_time(hour, minute, second, millisecond, microsecond, nanosecond)) return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidPlainTime); - // 3. If newTarget is not present, set it to %Temporal.PlainTime%. + // 3. If newTarget is not present, set newTarget to %Temporal.PlainTime%. if (!new_target) new_target = global_object.temporal_plain_time_constructor(); @@ -533,7 +533,7 @@ DaysAndTime round_time(u8 hour, u8 minute, u8 second, u16 millisecond, u16 micro // 3. If unit is "day", then if (unit == "day"sv) { - // a. If dayLengthNs is not present, set it to 8.64 × 10^13. + // a. If dayLengthNs is not present, set dayLengthNs to 8.64 × 10^13. if (!day_length_ns.has_value()) day_length_ns = 86400000000000; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp index d428bd490b..c5061404ce 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Linus Groh <linusg@serenityos.org> + * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -216,7 +216,7 @@ ThrowCompletionOr<PlainYearMonth*> create_temporal_year_month(GlobalObject& glob if (!iso_year_month_within_limits(iso_year, iso_month)) return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidPlainYearMonth); - // 5. If newTarget is not present, set it to %Temporal.PlainYearMonth%. + // 5. If newTarget is not present, set newTarget to %Temporal.PlainYearMonth%. if (!new_target) new_target = global_object.temporal_plain_year_month_constructor(); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp index a71dad6008..1cc4283341 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp @@ -65,7 +65,7 @@ String default_time_zone() // 11.6.1 CreateTemporalTimeZone ( identifier [ , newTarget ] ), https://tc39.es/proposal-temporal/#sec-temporal-createtemporaltimezone ThrowCompletionOr<TimeZone*> create_temporal_time_zone(GlobalObject& global_object, String const& identifier, FunctionObject const* new_target) { - // 1. If newTarget is not present, set it to %Temporal.TimeZone%. + // 1. If newTarget is not present, set newTarget to %Temporal.TimeZone%. if (!new_target) new_target = global_object.temporal_time_zone_constructor(); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp index 76dcd2a194..77e3a8ce3f 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp @@ -273,7 +273,7 @@ ThrowCompletionOr<ZonedDateTime*> create_temporal_zoned_date_time(GlobalObject& // 2. Assert: ! IsValidEpochNanoseconds(epochNanoseconds) is true. VERIFY(is_valid_epoch_nanoseconds(epoch_nanoseconds)); - // 5. If newTarget is not present, set it to %Temporal.ZonedDateTime%. + // 5. If newTarget is not present, set newTarget to %Temporal.ZonedDateTime%. if (!new_target) new_target = global_object.temporal_zoned_date_time_constructor(); @@ -292,15 +292,15 @@ ThrowCompletionOr<String> temporal_zoned_date_time_to_string(GlobalObject& globa { // 1. Assert: Type(zonedDateTime) is Object and zonedDateTime has an [[InitializedTemporalZonedDateTime]] internal slot. - // 2. If increment is not present, set it to 1. + // 2. If increment is not present, set increment to 1. if (!increment.has_value()) increment = 1; - // 3. If unit is not present, set it to "nanosecond". + // 3. If unit is not present, set unit to "nanosecond". if (!unit.has_value()) unit = "nanosecond"sv; - // 4. If roundingMode is not present, set it to "trunc". + // 4. If roundingMode is not present, set roundingMode to "trunc". if (!rounding_mode.has_value()) rounding_mode = "trunc"sv; |