mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
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:
parent
d2e4da62c8
commit
2d11fc6d44
Notes:
sideshowbarker
2024-07-16 23:51:07 +09:00
Author: https://github.com/dlarocque Commit: https://github.com/SerenityOS/serenity/commit/2d11fc6d44 Pull-request: https://github.com/SerenityOS/serenity/pull/23653 Reviewed-by: https://github.com/shannonbooth ✅
7 changed files with 13 additions and 13 deletions
|
@ -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> {}));
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue