diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp index ce8b24b665..11a9c61281 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormat.cpp @@ -401,7 +401,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(), js_string(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))); // 2. Let dataLocale be durationFormat.[[DataLocale]]. auto const& data_locale = duration_format.data_locale(); @@ -455,17 +455,17 @@ Vector<PatternPartition> partition_duration_format_pattern(VM& vm, DurationForma // ii. Else, else { // 1. Perform ! CreateDataPropertyOrThrow(nfOpts, "style", "unit"). - MUST(number_format_options->create_data_property_or_throw(vm.names.style, js_string(vm, "unit"sv))); + MUST(number_format_options->create_data_property_or_throw(vm.names.style, PrimitiveString::create(vm, "unit"sv))); // 2. Perform ! CreateDataPropertyOrThrow(nfOpts, "unit", numberFormatUnit). - MUST(number_format_options->create_data_property_or_throw(vm.names.unit, js_string(vm, number_format_unit))); + MUST(number_format_options->create_data_property_or_throw(vm.names.unit, PrimitiveString::create(vm, number_format_unit))); // 3. Perform ! CreateDataPropertyOrThrow(nfOpts, "unitDisplay", style). auto unicode_style = ::Locale::style_to_string(static_cast<::Locale::Style>(style)); - MUST(number_format_options->create_data_property_or_throw(vm.names.unitDisplay, js_string(vm, unicode_style))); + 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(), js_string(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))); // 5. Let parts be ! PartitionNumberPattern(nf, 𝔽(value)). auto parts = partition_number_pattern(vm, *number_format, MathematicalValue(value)); @@ -489,7 +489,7 @@ Vector<PatternPartition> partition_duration_format_pattern(VM& vm, DurationForma auto* list_format_options = Object::create(realm, nullptr); // 5. Perform ! CreateDataPropertyOrThrow(lfOpts, "type", "unit"). - MUST(list_format_options->create_data_property_or_throw(vm.names.type, js_string(vm, "unit"sv))); + MUST(list_format_options->create_data_property_or_throw(vm.names.type, PrimitiveString::create(vm, "unit"sv))); // 6. Let listStyle be durationFormat.[[Style]]. auto list_style = duration_format.style(); @@ -503,10 +503,10 @@ Vector<PatternPartition> partition_duration_format_pattern(VM& vm, DurationForma auto unicode_list_style = ::Locale::style_to_string(static_cast<::Locale::Style>(list_style)); // 8. Perform ! CreateDataPropertyOrThrow(lfOpts, "style", listStyle). - MUST(list_format_options->create_data_property_or_throw(vm.names.style, js_string(vm, unicode_list_style))); + 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(), js_string(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))); // 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 |