LibJS: Rename ToSecondsStringPrecision to ToSecondsStringPrecisionRecord

This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/60f1052
This commit is contained in:
forchane 2024-03-20 10:28:08 -05:00 committed by Tim Flynn
parent d2e4da62c8
commit 2d11fc6d44
Notes: sideshowbarker 2024-07-16 23:51:07 +09:00
7 changed files with 13 additions and 13 deletions

View File

@ -355,8 +355,8 @@ ThrowCompletionOr<u64> to_temporal_date_time_rounding_increment(VM& vm, Object c
return validate_temporal_rounding_increment(vm, increment, maximum, false);
}
// 13.14 ToSecondsStringPrecision ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-tosecondsstringprecision
ThrowCompletionOr<SecondsStringPrecision> to_seconds_string_precision(VM& vm, Object const& normalized_options)
// 13.14 ToSecondsStringPrecisionRecord ( normalizedOptions ), https://tc39.es/proposal-temporal/#sec-temporal-tosecondsstringprecisionrecord
ThrowCompletionOr<SecondsStringPrecision> to_seconds_string_precision_record(VM& vm, Object const& normalized_options)
{
// 1. Let smallestUnit be ? GetTemporalUnit(normalizedOptions, "smallestUnit", time, undefined).
auto smallest_unit = TRY(get_temporal_unit(vm, normalized_options, vm.names.smallestUnit, UnitGroup::Time, Optional<StringView> {}));

View File

@ -148,7 +148,7 @@ ThrowCompletionOr<String> to_show_offset_option(VM&, Object const& normalized_op
ThrowCompletionOr<double> to_temporal_rounding_increment(VM& vm, Object const& normalized_options);
ThrowCompletionOr<u64> validate_temporal_rounding_increment(VM& vm, double increment, double dividend, bool inclusive);
ThrowCompletionOr<u64> to_temporal_date_time_rounding_increment(VM&, Object const& normalized_options, StringView smallest_unit);
ThrowCompletionOr<SecondsStringPrecision> to_seconds_string_precision(VM&, Object const& normalized_options);
ThrowCompletionOr<SecondsStringPrecision> to_seconds_string_precision_record(VM&, Object const& normalized_options);
ThrowCompletionOr<Optional<String>> get_temporal_unit(VM&, Object const& normalized_options, PropertyKey const&, UnitGroup, TemporalUnitDefault const& default_, Vector<StringView> const& extra_values = {});
struct RelativeTo {

View File

@ -531,8 +531,8 @@ JS_DEFINE_NATIVE_FUNCTION(DurationPrototype::to_string)
// 3. Set options to ? GetOptionsObject(options).
auto const* options = TRY(get_options_object(vm, vm.argument(0)));
// 4. Let precision be ? ToSecondsStringPrecision(options).
auto precision = TRY(to_seconds_string_precision(vm, *options));
// 4. Let precision be ? ToSecondsStringPrecisionRecord(options).
auto precision = TRY(to_seconds_string_precision_record(vm, *options));
// 5. If precision.[[Unit]] is "minute", throw a RangeError exception.
if (precision.unit == "minute"sv)

View File

@ -304,8 +304,8 @@ JS_DEFINE_NATIVE_FUNCTION(InstantPrototype::to_string)
time_zone = TRY(to_temporal_time_zone(vm, time_zone));
}
// 6. Let precision be ? ToSecondsStringPrecision(options).
auto precision = TRY(to_seconds_string_precision(vm, *options));
// 6. Let precision be ? ToSecondsStringPrecisionRecord(options).
auto precision = TRY(to_seconds_string_precision_record(vm, *options));
// 7. Let roundingMode be ? ToTemporalRoundingMode(options, "trunc").
auto rounding_mode = TRY(to_temporal_rounding_mode(vm, *options, "trunc"sv));

View File

@ -611,8 +611,8 @@ JS_DEFINE_NATIVE_FUNCTION(PlainDateTimePrototype::to_string)
// 3. Set options to ? GetOptionsObject(options).
auto* options = TRY(get_options_object(vm, vm.argument(0)));
// 4. Let precision be ? ToSecondsStringPrecision(options).
auto precision = TRY(to_seconds_string_precision(vm, *options));
// 4. Let precision be ? ToSecondsStringPrecisionRecord(options).
auto precision = TRY(to_seconds_string_precision_record(vm, *options));
// 5. Let roundingMode be ? ToTemporalRoundingMode(options, "trunc").
auto rounding_mode = TRY(to_temporal_rounding_mode(vm, *options, "trunc"sv));

View File

@ -470,8 +470,8 @@ JS_DEFINE_NATIVE_FUNCTION(PlainTimePrototype::to_string)
// 3. Set options to ? GetOptionsObject(options).
auto* options = TRY(get_options_object(vm, vm.argument(0)));
// 4. Let precision be ? ToSecondsStringPrecision(options).
auto precision = TRY(to_seconds_string_precision(vm, *options));
// 4. Let precision be ? ToSecondsStringPrecisionRecord(options).
auto precision = TRY(to_seconds_string_precision_record(vm, *options));
// 5. Let roundingMode be ? ToTemporalRoundingMode(options, "trunc").
auto rounding_mode = TRY(to_temporal_rounding_mode(vm, *options, "trunc"sv));

View File

@ -1106,8 +1106,8 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_string)
// 3. Set options to ? GetOptionsObject(options).
auto* options = TRY(get_options_object(vm, vm.argument(0)));
// 4. Let precision be ? ToSecondsStringPrecision(options).
auto precision = TRY(to_seconds_string_precision(vm, *options));
// 4. Let precision be ? ToSecondsStringPrecisionRecord(options).
auto precision = TRY(to_seconds_string_precision_record(vm, *options));
// 5. Let roundingMode be ? ToTemporalRoundingMode(options, "trunc").
auto rounding_mode = TRY(to_temporal_rounding_mode(vm, *options, "trunc"sv));