diff options
author | Linus Groh <mail@linusgroh.de> | 2021-12-18 17:09:27 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-12-18 22:32:39 +0000 |
commit | 7270bbb25547f165e6a12609e8ea76736dcdffe5 (patch) | |
tree | 94562097e0b59bd58a6431492b808de1601d4472 | |
parent | 247d2f7cc4d0fafe82dd5d48532f3afee9ce4dc2 (diff) | |
download | serenity-7270bbb25547f165e6a12609e8ea76736dcdffe5.zip |
LibJS: Remove outdated comment from parse_temporal_duration_string()
This is a normative change in the Temporal spec.
See:
- https://github.com/tc39/proposal-temporal/commit/e7182d3
- https://github.com/tc39/proposal-temporal/commit/6dae066
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp | 86 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h | 4 |
2 files changed, 42 insertions, 48 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index 2f67c61146..99309effc1 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -191,7 +191,7 @@ ThrowCompletionOr<Variant<String, NumberType>> get_string_or_number_option(Globa return value.as_string().string(); } -// 13.6 ToTemporalOverflow ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaloverflow +// 13.5 ToTemporalOverflow ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaloverflow ThrowCompletionOr<String> to_temporal_overflow(GlobalObject& global_object, Object const& normalized_options) { auto& vm = global_object.vm(); @@ -203,7 +203,7 @@ ThrowCompletionOr<String> to_temporal_overflow(GlobalObject& global_object, Obje return option.as_string().string(); } -// 13.7 ToTemporalDisambiguation ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaldisambiguation +// 13.6 ToTemporalDisambiguation ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaldisambiguation ThrowCompletionOr<String> to_temporal_disambiguation(GlobalObject& global_object, Object const& normalized_options) { auto& vm = global_object.vm(); @@ -215,7 +215,7 @@ ThrowCompletionOr<String> to_temporal_disambiguation(GlobalObject& global_object return option.as_string().string(); } -// 13.8 ToTemporalRoundingMode ( normalizedOptions, fallback ), https://tc39.es/proposal-temporal/#sec-temporal-totemporalroundingmode +// 13.7 ToTemporalRoundingMode ( normalizedOptions, fallback ), https://tc39.es/proposal-temporal/#sec-temporal-totemporalroundingmode ThrowCompletionOr<String> to_temporal_rounding_mode(GlobalObject& global_object, Object const& normalized_options, String const& fallback) { auto& vm = global_object.vm(); @@ -227,7 +227,7 @@ ThrowCompletionOr<String> to_temporal_rounding_mode(GlobalObject& global_object, return option.as_string().string(); } -// 13.9 NegateTemporalRoundingMode ( roundingMode ), https://tc39.es/proposal-temporal/#sec-temporal-negatetemporalroundingmode +// 13.8 NegateTemporalRoundingMode ( roundingMode ), https://tc39.es/proposal-temporal/#sec-temporal-negatetemporalroundingmode StringView negate_temporal_rounding_mode(String const& rounding_mode) { // 1. If roundingMode is "ceil", return "floor". @@ -242,7 +242,7 @@ StringView negate_temporal_rounding_mode(String const& rounding_mode) return rounding_mode; } -// 13.10 ToTemporalOffset ( normalizedOptions, fallback ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaloffset +// 13.9 ToTemporalOffset ( normalizedOptions, fallback ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaloffset ThrowCompletionOr<String> to_temporal_offset(GlobalObject& global_object, Object const& normalized_options, String const& fallback) { auto& vm = global_object.vm(); @@ -254,7 +254,7 @@ ThrowCompletionOr<String> to_temporal_offset(GlobalObject& global_object, Object return option.as_string().string(); } -// 13.11 ToShowCalendarOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-toshowcalendaroption +// 13.10 ToShowCalendarOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-toshowcalendaroption ThrowCompletionOr<String> to_show_calendar_option(GlobalObject& global_object, Object const& normalized_options) { auto& vm = global_object.vm(); @@ -266,7 +266,7 @@ ThrowCompletionOr<String> to_show_calendar_option(GlobalObject& global_object, O return option.as_string().string(); } -// 13.12 ToShowTimeZoneNameOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-toshowtimezonenameoption +// 13.11 ToShowTimeZoneNameOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-toshowtimezonenameoption ThrowCompletionOr<String> to_show_time_zone_name_option(GlobalObject& global_object, Object const& normalized_options) { auto& vm = global_object.vm(); @@ -278,7 +278,7 @@ ThrowCompletionOr<String> to_show_time_zone_name_option(GlobalObject& global_obj return option.as_string().string(); } -// 13.13 ToShowOffsetOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-toshowoffsetoption +// 13.12 ToShowOffsetOption ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-toshowoffsetoption ThrowCompletionOr<String> to_show_offset_option(GlobalObject& global_object, Object const& normalized_options) { auto& vm = global_object.vm(); @@ -290,7 +290,7 @@ ThrowCompletionOr<String> to_show_offset_option(GlobalObject& global_object, Obj return option.as_string().string(); } -// 13.14 ToTemporalRoundingIncrement ( normalizedOptions, dividend, inclusive ), https://tc39.es/proposal-temporal/#sec-temporal-totemporalroundingincrement +// 13.13 ToTemporalRoundingIncrement ( normalizedOptions, dividend, inclusive ), https://tc39.es/proposal-temporal/#sec-temporal-totemporalroundingincrement ThrowCompletionOr<u64> to_temporal_rounding_increment(GlobalObject& global_object, Object const& normalized_options, Optional<double> dividend, bool inclusive) { auto& vm = global_object.vm(); @@ -338,7 +338,7 @@ ThrowCompletionOr<u64> to_temporal_rounding_increment(GlobalObject& global_objec return floored_increment; } -// 13.15 ToTemporalDateTimeRoundingIncrement ( normalizedOptions, smallestUnit ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaldatetimeroundingincrement +// 13.14 ToTemporalDateTimeRoundingIncrement ( normalizedOptions, smallestUnit ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaldatetimeroundingincrement ThrowCompletionOr<u64> to_temporal_date_time_rounding_increment(GlobalObject& global_object, Object const& normalized_options, StringView smallest_unit) { double maximum; @@ -371,7 +371,7 @@ ThrowCompletionOr<u64> to_temporal_date_time_rounding_increment(GlobalObject& gl return to_temporal_rounding_increment(global_object, normalized_options, maximum, false); } -// 13.16 ToSecondsStringPrecision ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-tosecondsstringprecision +// 13.15 ToSecondsStringPrecision ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-tosecondsstringprecision ThrowCompletionOr<SecondsStringPrecision> to_seconds_string_precision(GlobalObject& global_object, Object const& normalized_options) { auto& vm = global_object.vm(); @@ -463,7 +463,7 @@ static HashMap<StringView, StringView> plural_to_singular_units = { { "nanoseconds"sv, "nanosecond"sv } }; -// 13.17 ToLargestTemporalUnit ( normalizedOptions, disallowedUnits, fallback [ , autoValue ] ), https://tc39.es/proposal-temporal/#sec-temporal-tolargesttemporalunit +// 13.16 ToLargestTemporalUnit ( normalizedOptions, disallowedUnits, fallback [ , autoValue ] ), https://tc39.es/proposal-temporal/#sec-temporal-tolargesttemporalunit ThrowCompletionOr<Optional<String>> to_largest_temporal_unit(GlobalObject& global_object, Object const& normalized_options, Vector<StringView> const& disallowed_units, Optional<String> fallback, Optional<String> auto_value) { auto& vm = global_object.vm(); @@ -505,7 +505,7 @@ ThrowCompletionOr<Optional<String>> to_largest_temporal_unit(GlobalObject& globa return largest_unit; } -// 13.18 ToSmallestTemporalUnit ( normalizedOptions, disallowedUnits, fallback ), https://tc39.es/proposal-temporal/#sec-temporal-tosmallesttemporalunit +// 13.17 ToSmallestTemporalUnit ( normalizedOptions, disallowedUnits, fallback ), https://tc39.es/proposal-temporal/#sec-temporal-tosmallesttemporalunit ThrowCompletionOr<Optional<String>> to_smallest_temporal_unit(GlobalObject& global_object, Object const& normalized_options, Vector<StringView> const& disallowed_units, Optional<String> fallback) { auto& vm = global_object.vm(); @@ -537,7 +537,7 @@ ThrowCompletionOr<Optional<String>> to_smallest_temporal_unit(GlobalObject& glob return smallest_unit; } -// 13.19 ToTemporalDurationTotalUnit ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaldurationtotalunit +// 13.18 ToTemporalDurationTotalUnit ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaldurationtotalunit ThrowCompletionOr<String> to_temporal_duration_total_unit(GlobalObject& global_object, Object const& normalized_options) { auto& vm = global_object.vm(); @@ -563,7 +563,7 @@ ThrowCompletionOr<String> to_temporal_duration_total_unit(GlobalObject& global_o return unit; } -// 13.21 ToRelativeTemporalObject ( options ), https://tc39.es/proposal-temporal/#sec-temporal-torelativetemporalobject +// 13.20 ToRelativeTemporalObject ( options ), https://tc39.es/proposal-temporal/#sec-temporal-torelativetemporalobject ThrowCompletionOr<Value> to_relative_temporal_object(GlobalObject& global_object, Object const& options) { auto& vm = global_object.vm(); @@ -709,7 +709,7 @@ ThrowCompletionOr<Value> to_relative_temporal_object(GlobalObject& global_object return TRY(create_temporal_date(global_object, result.year, result.month, result.day, *calendar)); } -// 13.22 ValidateTemporalUnitRange ( largestUnit, smallestUnit ), https://tc39.es/proposal-temporal/#sec-temporal-validatetemporalunitrange +// 13.21 ValidateTemporalUnitRange ( largestUnit, smallestUnit ), https://tc39.es/proposal-temporal/#sec-temporal-validatetemporalunitrange ThrowCompletionOr<void> validate_temporal_unit_range(GlobalObject& global_object, StringView largest_unit, StringView smallest_unit) { auto& vm = global_object.vm(); @@ -763,7 +763,7 @@ ThrowCompletionOr<void> validate_temporal_unit_range(GlobalObject& global_object return {}; } -// 13.23 LargerOfTwoTemporalUnits ( u1, u2 ), https://tc39.es/proposal-temporal/#sec-temporal-largeroftwotemporalunits +// 13.22 LargerOfTwoTemporalUnits ( u1, u2 ), https://tc39.es/proposal-temporal/#sec-temporal-largeroftwotemporalunits StringView larger_of_two_temporal_units(StringView unit1, StringView unit2) { // 1. If either u1 or u2 is "year", return "year". @@ -797,7 +797,7 @@ StringView larger_of_two_temporal_units(StringView unit1, StringView unit2) return "nanosecond"sv; } -// 13.24 MergeLargestUnitOption ( options, largestUnit ), https://tc39.es/proposal-temporal/#sec-temporal-mergelargestunitoption +// 13.23 MergeLargestUnitOption ( options, largestUnit ), https://tc39.es/proposal-temporal/#sec-temporal-mergelargestunitoption ThrowCompletionOr<Object*> merge_largest_unit_option(GlobalObject& global_object, Object& options, String largest_unit) { auto& vm = global_object.vm(); @@ -826,7 +826,7 @@ ThrowCompletionOr<Object*> merge_largest_unit_option(GlobalObject& global_object return merged; } -// 13.25 MaximumTemporalDurationRoundingIncrement ( unit ), https://tc39.es/proposal-temporal/#sec-temporal-maximumtemporaldurationroundingincrement +// 13.24 MaximumTemporalDurationRoundingIncrement ( unit ), https://tc39.es/proposal-temporal/#sec-temporal-maximumtemporaldurationroundingincrement Optional<u16> maximum_temporal_duration_rounding_increment(StringView unit) { // 1. If unit is "year", "month", "week", or "day", then @@ -854,7 +854,7 @@ Optional<u16> maximum_temporal_duration_rounding_increment(StringView unit) return 1000; } -// 13.26 RejectObjectWithCalendarOrTimeZone ( object ), https://tc39.es/proposal-temporal/#sec-temporal-rejectobjectwithcalendarortimezone +// 13.25 RejectObjectWithCalendarOrTimeZone ( object ), https://tc39.es/proposal-temporal/#sec-temporal-rejectobjectwithcalendarortimezone ThrowCompletionOr<void> reject_object_with_calendar_or_time_zone(GlobalObject& global_object, Object& object) { auto& vm = global_object.vm(); @@ -888,7 +888,7 @@ ThrowCompletionOr<void> reject_object_with_calendar_or_time_zone(GlobalObject& g return {}; } -// 13.27 FormatSecondsStringPart ( second, millisecond, microsecond, nanosecond, precision ), https://tc39.es/proposal-temporal/#sec-temporal-formatsecondsstringpart +// 13.26 FormatSecondsStringPart ( second, millisecond, microsecond, nanosecond, precision ), https://tc39.es/proposal-temporal/#sec-temporal-formatsecondsstringpart String format_seconds_string_part(u8 second, u16 millisecond, u16 microsecond, u16 nanosecond, Variant<StringView, u8> const& precision) { // 1. Assert: second, millisecond, microsecond and nanosecond are integers. @@ -938,7 +938,7 @@ String format_seconds_string_part(u8 second, u16 millisecond, u16 microsecond, u return String::formatted("{}.{}", seconds_string, fraction_string); } -// 13.28 Sign ( n ), https://tc39.es/proposal-temporal/#sec-temporal-sign +// 13.27 Sign ( n ), https://tc39.es/proposal-temporal/#sec-temporal-sign double sign(double n) { // 1. If n is NaN, n is +0𝔽, or n is −0𝔽, return n. @@ -967,7 +967,7 @@ double sign(Crypto::SignedBigInteger const& n) return 1; } -// 13.29 ConstrainToRange ( x, minimum, maximum ), https://tc39.es/proposal-temporal/#sec-temporal-constraintorange +// 13.28 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. @@ -981,7 +981,7 @@ double constrain_to_range(double x, double minimum, double maximum) // it uses mathematical values which can be arbitrarily (but not infinitely) large. // Incidentally V8's Temporal implementation does the same :^) -// 13.32 RoundNumberToIncrement ( x, increment, roundingMode ), https://tc39.es/proposal-temporal/#sec-temporal-roundnumbertoincrement +// 13.31 RoundNumberToIncrement ( x, increment, roundingMode ), https://tc39.es/proposal-temporal/#sec-temporal-roundnumbertoincrement i64 round_number_to_increment(double x, u64 increment, StringView rounding_mode) { // 1. Assert: x and increment are mathematical values. @@ -1018,7 +1018,7 @@ i64 round_number_to_increment(double x, u64 increment, StringView rounding_mode) return (i64)rounded * (i64)increment; } -// 13.32 RoundNumberToIncrement ( x, increment, roundingMode ), https://tc39.es/proposal-temporal/#sec-temporal-roundnumbertoincrement +// 13.31 RoundNumberToIncrement ( x, increment, roundingMode ), https://tc39.es/proposal-temporal/#sec-temporal-roundnumbertoincrement BigInt* round_number_to_increment(GlobalObject& global_object, BigInt const& x, u64 increment, StringView rounding_mode) { auto& heap = global_object.heap(); @@ -1072,7 +1072,7 @@ BigInt* round_number_to_increment(GlobalObject& global_object, BigInt const& x, return js_bigint(heap, rounded.multiplied_by(increment_big_int)); } -// 13.34 ParseISODateTime ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parseisodatetime +// 13.33 ParseISODateTime ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parseisodatetime ThrowCompletionOr<ISODateTime> parse_iso_date_time(GlobalObject& global_object, ParseResult const& parse_result) { auto& vm = global_object.vm(); @@ -1177,7 +1177,7 @@ ThrowCompletionOr<ISODateTime> parse_iso_date_time(GlobalObject& global_object, return ISODateTime { .year = year, .month = month, .day = day, .hour = hour, .minute = minute, .second = second, .millisecond = millisecond, .microsecond = microsecond, .nanosecond = nanosecond, .calendar = calendar_part.has_value() ? *calendar_part : Optional<String>() }; } -// 13.35 ParseTemporalInstantString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalinstantstring +// 13.34 ParseTemporalInstantString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalinstantstring ThrowCompletionOr<TemporalInstant> parse_temporal_instant_string(GlobalObject& global_object, String const& iso_string) { auto& vm = global_object.vm(); @@ -1213,7 +1213,7 @@ ThrowCompletionOr<TemporalInstant> parse_temporal_instant_string(GlobalObject& g return TemporalInstant { .year = result.year, .month = result.month, .day = result.day, .hour = result.hour, .minute = result.minute, .second = result.second, .millisecond = result.millisecond, .microsecond = result.microsecond, .nanosecond = result.nanosecond, .time_zone_offset = move(offset_string) }; } -// 13.36 ParseTemporalZonedDateTimeString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalzoneddatetimestring +// 13.35 ParseTemporalZonedDateTimeString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalzoneddatetimestring ThrowCompletionOr<TemporalZonedDateTime> parse_temporal_zoned_date_time_string(GlobalObject& global_object, String const& iso_string) { auto& vm = global_object.vm(); @@ -1239,7 +1239,7 @@ ThrowCompletionOr<TemporalZonedDateTime> parse_temporal_zoned_date_time_string(G return TemporalZonedDateTime { .date_time = move(result), .time_zone = move(time_zone_result) }; } -// 13.37 ParseTemporalCalendarString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalcalendarstring +// 13.36 ParseTemporalCalendarString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalcalendarstring ThrowCompletionOr<String> parse_temporal_calendar_string(GlobalObject& global_object, String const& iso_string) { auto& vm = global_object.vm(); @@ -1266,7 +1266,7 @@ ThrowCompletionOr<String> parse_temporal_calendar_string(GlobalObject& global_ob return id_part.value(); } -// 13.38 ParseTemporalDateString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaldatestring +// 13.37 ParseTemporalDateString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaldatestring ThrowCompletionOr<TemporalDate> parse_temporal_date_string(GlobalObject& global_object, String const& iso_string) { auto& vm = global_object.vm(); @@ -1293,7 +1293,7 @@ ThrowCompletionOr<TemporalDate> parse_temporal_date_string(GlobalObject& global_ return TemporalDate { .year = result.year, .month = result.month, .day = result.day, .calendar = move(result.calendar) }; } -// 13.39 ParseTemporalDateTimeString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaldatetimestring +// 13.38 ParseTemporalDateTimeString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaldatetimestring ThrowCompletionOr<ISODateTime> parse_temporal_date_time_string(GlobalObject& global_object, String const& iso_string) { auto& vm = global_object.vm(); @@ -1317,15 +1317,9 @@ ThrowCompletionOr<ISODateTime> parse_temporal_date_time_string(GlobalObject& glo return parse_iso_date_time(global_object, *parse_result); } -// 13.40 ParseTemporalDurationString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaldurationstring +// 13.39 ParseTemporalDurationString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaldurationstring ThrowCompletionOr<TemporalDuration> parse_temporal_duration_string(GlobalObject& global_object, String const& iso_string) { - // NOTE: The steps here are the ones from the following PR and not the ones in the spec at the - // time of implementing this - it is already accepted, but hasn't been merged yet. - // Due to removal of the DurationHandleFractions AO every section number gets shifted by one, - // i.e. this becomes 13.39 - I'll do that once the PR is actually merged. - // Normative: Simplify Duration parsing, https://github.com/tc39/proposal-temporal/pull/1907 - auto& vm = global_object.vm(); // 1. Assert: Type(isoString) is String. @@ -1465,7 +1459,7 @@ ThrowCompletionOr<TemporalDuration> parse_temporal_duration_string(GlobalObject& return TemporalDuration { .years = years * factor, .months = months * factor, .weeks = weeks * factor, .days = days * factor, .hours = hours * factor, .minutes = floor(minutes) * factor, .seconds = floor(seconds) * factor, .milliseconds = floor(milliseconds) * factor, .microseconds = floor(microseconds) * factor, .nanoseconds = floor(nanoseconds) * factor }; } -// 13.41 ParseTemporalMonthDayString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalmonthdaystring +// 13.40 ParseTemporalMonthDayString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalmonthdaystring ThrowCompletionOr<TemporalMonthDay> parse_temporal_month_day_string(GlobalObject& global_object, String const& iso_string) { auto& vm = global_object.vm(); @@ -1501,7 +1495,7 @@ ThrowCompletionOr<TemporalMonthDay> parse_temporal_month_day_string(GlobalObject return TemporalMonthDay { .year = year, .month = result.month, .day = result.day, .calendar = move(result.calendar) }; } -// 13.42 ParseTemporalRelativeToString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalrelativetostring +// 13.41 ParseTemporalRelativeToString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalrelativetostring ThrowCompletionOr<TemporalZonedDateTime> parse_temporal_relative_to_string(GlobalObject& global_object, String const& iso_string) { auto& vm = global_object.vm(); @@ -1550,7 +1544,7 @@ ThrowCompletionOr<TemporalZonedDateTime> parse_temporal_relative_to_string(Globa return TemporalZonedDateTime { .date_time = move(result), .time_zone = { .z = z, .offset = move(offset), .name = move(time_zone) } }; } -// 13.43 ParseTemporalTimeString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaltimestring +// 13.42 ParseTemporalTimeString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaltimestring ThrowCompletionOr<TemporalTime> parse_temporal_time_string(GlobalObject& global_object, String const& iso_string) { auto& vm = global_object.vm(); @@ -1577,7 +1571,7 @@ ThrowCompletionOr<TemporalTime> parse_temporal_time_string(GlobalObject& global_ return TemporalTime { .hour = result.hour, .minute = result.minute, .second = result.second, .millisecond = result.millisecond, .microsecond = result.microsecond, .nanosecond = result.nanosecond, .calendar = move(result.calendar) }; } -// 13.44 ParseTemporalTimeZoneString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaltimezonestring +// 13.43 ParseTemporalTimeZoneString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaltimezonestring ThrowCompletionOr<TemporalTimeZone> parse_temporal_time_zone_string(GlobalObject& global_object, String const& iso_string) { auto& vm = global_object.vm(); @@ -1673,7 +1667,7 @@ ThrowCompletionOr<TemporalTimeZone> parse_temporal_time_zone_string(GlobalObject return TemporalTimeZone { .z = false, .offset = offset, .name = name }; } -// 13.45 ParseTemporalYearMonthString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalyearmonthstring +// 13.44 ParseTemporalYearMonthString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalyearmonthstring ThrowCompletionOr<TemporalYearMonth> parse_temporal_year_month_string(GlobalObject& global_object, String const& iso_string) { auto& vm = global_object.vm(); @@ -1700,7 +1694,7 @@ ThrowCompletionOr<TemporalYearMonth> parse_temporal_year_month_string(GlobalObje return TemporalYearMonth { .year = result.year, .month = result.month, .day = result.day, .calendar = move(result.calendar) }; } -// 13.46 ToPositiveInteger ( argument ), https://tc39.es/proposal-temporal/#sec-temporal-topositiveinteger +// 13.45 ToPositiveInteger ( argument ), https://tc39.es/proposal-temporal/#sec-temporal-topositiveinteger ThrowCompletionOr<double> to_positive_integer(GlobalObject& global_object, Value argument) { auto& vm = global_object.vm(); @@ -1718,7 +1712,7 @@ ThrowCompletionOr<double> to_positive_integer(GlobalObject& global_object, Value return integer; } -// 13.49 PrepareTemporalFields ( fields, fieldNames, requiredFields ), https://tc39.es/proposal-temporal/#sec-temporal-preparetemporalfields +// 13.48 PrepareTemporalFields ( fields, fieldNames, requiredFields ), https://tc39.es/proposal-temporal/#sec-temporal-preparetemporalfields ThrowCompletionOr<Object*> prepare_temporal_fields(GlobalObject& global_object, Object const& fields, Vector<String> const& field_names, Vector<StringView> const& required_fields) { auto& vm = global_object.vm(); @@ -1769,7 +1763,7 @@ ThrowCompletionOr<Object*> prepare_temporal_fields(GlobalObject& global_object, return result; } -// 13.50 PreparePartialTemporalFields ( fields, fieldNames ), https://tc39.es/proposal-temporal/#sec-temporal-preparepartialtemporalfields +// 13.49 PreparePartialTemporalFields ( fields, fieldNames ), https://tc39.es/proposal-temporal/#sec-temporal-preparepartialtemporalfields ThrowCompletionOr<Object*> prepare_partial_temporal_fields(GlobalObject& global_object, Object const& fields, Vector<String> const& field_names) { auto& vm = global_object.vm(); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h index e7ed67f3ba..37aa8f21cd 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h @@ -144,7 +144,7 @@ ThrowCompletionOr<double> to_positive_integer(GlobalObject&, Value argument); ThrowCompletionOr<Object*> prepare_temporal_fields(GlobalObject&, Object const& fields, Vector<String> const& field_names, Vector<StringView> const& required_fields); ThrowCompletionOr<Object*> prepare_partial_temporal_fields(GlobalObject&, Object const& fields, Vector<String> const& field_names); -// 13.47 ToIntegerThrowOnInfinity ( argument ), https://tc39.es/proposal-temporal/#sec-temporal-tointegerthrowoninfinity +// 13.46 ToIntegerThrowOnInfinity ( argument ), https://tc39.es/proposal-temporal/#sec-temporal-tointegerthrowoninfinity template<typename... Args> ThrowCompletionOr<double> to_integer_throw_on_infinity(GlobalObject& global_object, Value argument, ErrorType error_type, Args... args) { @@ -163,7 +163,7 @@ ThrowCompletionOr<double> to_integer_throw_on_infinity(GlobalObject& global_obje return integer; } -// 13.48 ToIntegerWithoutRounding ( argument ), https://tc39.es/proposal-temporal/#sec-temporal-tointegerwithoutrounding +// 13.47 ToIntegerWithoutRounding ( argument ), https://tc39.es/proposal-temporal/#sec-temporal-tointegerwithoutrounding template<typename... Args> ThrowCompletionOr<double> to_integer_without_rounding(GlobalObject& global_object, Value argument, ErrorType error_type, Args... args) { |