1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:58:13 +00:00

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.
This commit is contained in:
Linus Groh 2022-12-06 22:17:27 +00:00
parent 5db38d7ba1
commit 525f22d018
144 changed files with 656 additions and 672 deletions

View file

@ -27,7 +27,7 @@ void ModuleNamespaceObject::initialize(Realm& realm)
Object::initialize(realm);
// 28.3.1 @@toStringTag, https://tc39.es/ecma262/#sec-@@tostringtag
define_direct_property(*vm().well_known_symbol_to_string_tag(), js_string(vm(), "Module"sv), 0);
define_direct_property(*vm().well_known_symbol_to_string_tag(), PrimitiveString::create(vm(), "Module"sv), 0);
}
// 10.4.6.1 [[GetPrototypeOf]] ( ), https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-getprototypeof
@ -219,7 +219,7 @@ ThrowCompletionOr<MarkedVector<Value>> ModuleNamespaceObject::internal_own_prope
// 3. Return the list-concatenation of exports and symbolKeys.
exports.ensure_capacity(m_exports.size() + symbol_keys.size());
for (auto const& export_name : m_exports)
exports.unchecked_append(js_string(vm(), export_name));
exports.unchecked_append(PrimitiveString::create(vm(), export_name));
exports.extend(symbol_keys);
return exports;