summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-06 22:17:27 +0000
committerLinus Groh <mail@linusgroh.de>2022-12-07 16:43:06 +0000
commit525f22d018cb5f9c4c6ea0e2b5544fdcab8da483 (patch)
tree2488bac4fab4acec0d258c9bac2338bc95ee6398 /Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp
parent5db38d7ba1a8caa5138dd65cc06be0c0e5a568e4 (diff)
downloadserenity-525f22d018cb5f9c4c6ea0e2b5544fdcab8da483.zip
LibJS: Replace standalone js_string() with PrimitiveString::create()
Note that js_rope_string() has been folded into this, the old name was misleading - it would not always create a rope string, only if both sides are not empty strings. Use a three-argument create() overload instead.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp
index ff3e0aabfe..a9ba5d3526 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp
@@ -39,7 +39,7 @@ void Intl::initialize(Realm& realm)
auto& vm = this->vm();
// 8.1.1 Intl[ @@toStringTag ], https://tc39.es/ecma402/#sec-Intl-toStringTag
- define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl"), Attribute::Configurable);
+ define_direct_property(*vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, "Intl"), Attribute::Configurable);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_intrinsic_accessor(vm.names.Collator, attr, [](auto& realm) -> Value { return realm.intrinsics().intl_collator_constructor(); });
@@ -70,7 +70,7 @@ JS_DEFINE_NATIVE_FUNCTION(Intl::get_canonical_locales)
MarkedVector<Value> marked_locale_list { vm.heap() };
marked_locale_list.ensure_capacity(locale_list.size());
for (auto& locale : locale_list)
- marked_locale_list.append(js_string(vm, move(locale)));
+ marked_locale_list.append(PrimitiveString::create(vm, move(locale)));
// 2. Return CreateArrayFromList(ll).
return Array::create_from(realm, marked_locale_list);
@@ -154,7 +154,7 @@ JS_DEFINE_NATIVE_FUNCTION(Intl::supported_values_of)
}
// 9. Return CreateArrayFromList( list ).
- return Array::create_from<StringView>(realm, list, [&](auto value) { return js_string(vm, value); });
+ return Array::create_from<StringView>(realm, list, [&](auto value) { return PrimitiveString::create(vm, value); });
}
}