diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Intl')
3 files changed, 9 insertions, 9 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp index 7fe44e48ff..57973e4711 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp @@ -548,8 +548,8 @@ ThrowCompletionOr<Vector<PatternPartition>> format_date_time_pattern(VM& vm, Dat auto const& data_locale = date_time_format.data_locale(); auto construct_number_format = [&](auto& options) -> ThrowCompletionOr<NumberFormat*> { - auto* number_format = TRY(construct(vm, *realm.intrinsics().intl_number_format_constructor(), PrimitiveString::create(vm, locale), options)); - return static_cast<NumberFormat*>(number_format); + auto number_format = TRY(construct(vm, *realm.intrinsics().intl_number_format_constructor(), PrimitiveString::create(vm, locale), options)); + return static_cast<NumberFormat*>(number_format.ptr()); }; // 4. Let nfOptions be OrdinaryObjectCreate(null). diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp index 43f9b21bfa..59dd10be74 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp @@ -437,7 +437,7 @@ Vector<PatternPartition> partition_duration_format_pattern(VM& vm, DurationForma // i. If style is "2-digit" or "numeric", then if (style == DurationFormat::ValueStyle::TwoDigit || style == DurationFormat::ValueStyle::Numeric) { // 1. Let nf be ! Construct(%NumberFormat%, « durationFormat.[[Locale]], nfOpts »). - auto* number_format = static_cast<NumberFormat*>(MUST(construct(vm, *realm.intrinsics().intl_number_format_constructor(), PrimitiveString::create(vm, duration_format.locale()), number_format_options))); + auto* number_format = static_cast<NumberFormat*>(MUST(construct(vm, *realm.intrinsics().intl_number_format_constructor(), PrimitiveString::create(vm, duration_format.locale()), number_format_options)).ptr()); // 2. Let dataLocale be durationFormat.[[DataLocale]]. auto const& data_locale = duration_format.data_locale(); @@ -501,7 +501,7 @@ Vector<PatternPartition> partition_duration_format_pattern(VM& vm, DurationForma MUST(number_format_options->create_data_property_or_throw(vm.names.unitDisplay, PrimitiveString::create(vm, unicode_style))); // 4. Let nf be ! Construct(%NumberFormat%, « durationFormat.[[Locale]], nfOpts »). - auto* number_format = static_cast<NumberFormat*>(MUST(construct(vm, *realm.intrinsics().intl_number_format_constructor(), PrimitiveString::create(vm, duration_format.locale()), number_format_options))); + auto* number_format = static_cast<NumberFormat*>(MUST(construct(vm, *realm.intrinsics().intl_number_format_constructor(), PrimitiveString::create(vm, duration_format.locale()), number_format_options)).ptr()); // 5. Let parts be ! PartitionNumberPattern(nf, 𝔽(value)). auto parts = partition_number_pattern(vm, *number_format, MathematicalValue(value)); @@ -542,7 +542,7 @@ Vector<PatternPartition> partition_duration_format_pattern(VM& vm, DurationForma MUST(list_format_options->create_data_property_or_throw(vm.names.style, PrimitiveString::create(vm, unicode_list_style))); // 9. Let lf be ! Construct(%ListFormat%, « durationFormat.[[Locale]], lfOpts »). - auto* list_format = static_cast<ListFormat*>(MUST(construct(vm, *realm.intrinsics().intl_list_format_constructor(), PrimitiveString::create(vm, duration_format.locale()), list_format_options))); + auto* list_format = static_cast<ListFormat*>(MUST(construct(vm, *realm.intrinsics().intl_list_format_constructor(), PrimitiveString::create(vm, duration_format.locale()), list_format_options)).ptr()); // 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 diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp index 60b5525c96..790e13b46c 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp @@ -138,12 +138,12 @@ ThrowCompletionOr<RelativeTimeFormat*> initialize_relative_time_format(VM& vm, R relative_time_format.set_numeric(numeric.as_string().deprecated_string()); // 19. Let relativeTimeFormat.[[NumberFormat]] be ! Construct(%NumberFormat%, « locale »). - auto* number_format = MUST(construct(vm, *realm.intrinsics().intl_number_format_constructor(), PrimitiveString::create(vm, locale))); - relative_time_format.set_number_format(static_cast<NumberFormat*>(number_format)); + auto number_format = MUST(construct(vm, *realm.intrinsics().intl_number_format_constructor(), PrimitiveString::create(vm, locale))); + relative_time_format.set_number_format(static_cast<NumberFormat*>(number_format.ptr())); // 20. Let relativeTimeFormat.[[PluralRules]] be ! Construct(%PluralRules%, « locale »). - auto* plural_rules = MUST(construct(vm, *realm.intrinsics().intl_plural_rules_constructor(), PrimitiveString::create(vm, locale))); - relative_time_format.set_plural_rules(static_cast<PluralRules*>(plural_rules)); + auto plural_rules = MUST(construct(vm, *realm.intrinsics().intl_plural_rules_constructor(), PrimitiveString::create(vm, locale))); + relative_time_format.set_plural_rules(static_cast<PluralRules*>(plural_rules.ptr())); // 21. Return relativeTimeFormat. return &relative_time_format; |