mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +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:
@@ -108,7 +108,7 @@ void ECMAScriptFunctionObject::initialize(Realm& realm)
|
||||
// are defined in the spec.
|
||||
|
||||
MUST(define_property_or_throw(vm.names.length, { .value = Value(m_function_length), .writable = false, .enumerable = false, .configurable = true }));
|
||||
MUST(define_property_or_throw(vm.names.name, { .value = js_string(vm, m_name.is_null() ? "" : m_name), .writable = false, .enumerable = false, .configurable = true }));
|
||||
MUST(define_property_or_throw(vm.names.name, { .value = PrimitiveString::create(vm, m_name.is_null() ? "" : m_name), .writable = false, .enumerable = false, .configurable = true }));
|
||||
|
||||
if (!m_is_arrow_function) {
|
||||
Object* prototype = nullptr;
|
||||
@@ -911,7 +911,7 @@ void ECMAScriptFunctionObject::set_name(FlyString const& name)
|
||||
VERIFY(!name.is_null());
|
||||
auto& vm = this->vm();
|
||||
m_name = name;
|
||||
MUST(define_property_or_throw(vm.names.name, { .value = js_string(vm, m_name), .writable = false, .enumerable = false, .configurable = true }));
|
||||
MUST(define_property_or_throw(vm.names.name, { .value = PrimitiveString::create(vm, m_name), .writable = false, .enumerable = false, .configurable = true }));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user