1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00:00

LibJS: Mark PartitionDurationFormatPattern as infallible

This is an editorial change in the Intl.DurationFormat proposal. See:
cea3b68
This commit is contained in:
Timothy Flynn 2022-08-30 11:16:38 -04:00 committed by Tim Flynn
parent aabd06722f
commit a28ff92106
3 changed files with 9 additions and 8 deletions

View file

@ -305,7 +305,7 @@ static String convert_number_format_pattern_to_duration_format_template(Unicode:
}
// 1.1.7 PartitionDurationFormatPattern ( durationFormat, duration ), https://tc39.es/proposal-intl-duration-format/#sec-partitiondurationformatpattern
ThrowCompletionOr<Vector<PatternPartition>> partition_duration_format_pattern(VM& vm, DurationFormat const& duration_format, Temporal::DurationRecord const& duration)
Vector<PatternPartition> partition_duration_format_pattern(VM& vm, DurationFormat const& duration_format, Temporal::DurationRecord const& duration)
{
auto& realm = *vm.current_realm();
@ -491,8 +491,8 @@ ThrowCompletionOr<Vector<PatternPartition>> partition_duration_format_pattern(VM
}
}
// 4. Let lf be ? Construct(%ListFormat%, « durationFormat.[[Locale]] »).
auto* list_format = static_cast<ListFormat*>(TRY(construct(vm, *realm.intrinsics().intl_list_format_constructor(), js_string(vm, duration_format.locale()))));
// 4. Let lf be ! Construct(%ListFormat%, « durationFormat.[[Locale]] »).
auto* list_format = static_cast<ListFormat*>(MUST(construct(vm, *realm.intrinsics().intl_list_format_constructor(), js_string(vm, duration_format.locale()))));
// FIXME: CreatePartsFromList expects a list of strings and creates a list of Pattern Partition records, but we already created a list of Pattern Partition records
// so we try to hack something together from it that looks mostly right