summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2021-09-24 19:39:01 +0100
committerAndreas Kling <kling@serenityos.org>2021-09-26 18:59:56 +0200
commite06762f312676695da5a17e86708c234204a382b (patch)
treede9349f58525dfd23187ce4ea5b11c8616b52659 /Userland
parent27dfd0170ed67896bb0dcf18a60bfab36a05f680 (diff)
downloadserenity-e06762f312676695da5a17e86708c234204a382b.zip
LibJS: Make Object::ordinary_set_with_own_descriptor non-static
This needs to be accessible for implementing IDL legacy platform objects.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Object.cpp10
-rw-r--r--Userland/Libraries/LibJS/Runtime/Object.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp
index 438382d06f..35bc15fe6c 100644
--- a/Userland/Libraries/LibJS/Runtime/Object.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Object.cpp
@@ -706,8 +706,6 @@ Value Object::internal_get(PropertyName const& property_name, Value receiver) co
return TRY_OR_DISCARD(vm.call(*getter, receiver));
}
-static bool ordinary_set_with_own_descriptor(Object&, PropertyName const&, Value, Value, Optional<PropertyDescriptor>);
-
// 10.1.9 [[Set]] ( P, V, Receiver ), https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-set-p-v-receiver
bool Object::internal_set(PropertyName const& property_name, Value value, Value receiver)
{
@@ -724,13 +722,13 @@ bool Object::internal_set(PropertyName const& property_name, Value value, Value
return {};
// 3. Return OrdinarySetWithOwnDescriptor(O, P, V, Receiver, ownDesc).
- return ordinary_set_with_own_descriptor(*this, property_name, value, receiver, own_descriptor);
+ return ordinary_set_with_own_descriptor(property_name, value, receiver, own_descriptor);
}
// 10.1.9.2 OrdinarySetWithOwnDescriptor ( O, P, V, Receiver, ownDesc ), https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor
-bool ordinary_set_with_own_descriptor(Object& object, PropertyName const& property_name, Value value, Value receiver, Optional<PropertyDescriptor> own_descriptor)
+bool Object::ordinary_set_with_own_descriptor(PropertyName const& property_name, Value value, Value receiver, Optional<PropertyDescriptor> own_descriptor)
{
- auto& vm = object.vm();
+ auto& vm = this->vm();
// 1. Assert: IsPropertyKey(P) is true.
VERIFY(property_name.is_valid());
@@ -738,7 +736,7 @@ bool ordinary_set_with_own_descriptor(Object& object, PropertyName const& proper
// 2. If ownDesc is undefined, then
if (!own_descriptor.has_value()) {
// a. Let parent be ? O.[[GetPrototypeOf]]().
- auto parent = object.internal_get_prototype_of();
+ auto parent = internal_get_prototype_of();
if (vm.exception())
return {};
diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h
index 350876dfc6..133a706303 100644
--- a/Userland/Libraries/LibJS/Runtime/Object.h
+++ b/Userland/Libraries/LibJS/Runtime/Object.h
@@ -102,6 +102,8 @@ public:
virtual bool internal_delete(PropertyName const&);
virtual MarkedValueList internal_own_property_keys() const;
+ bool ordinary_set_with_own_descriptor(PropertyName const&, Value, Value, Optional<PropertyDescriptor>);
+
// 10.4.7 Immutable Prototype Exotic Objects, https://tc39.es/ecma262/#sec-immutable-prototype-exotic-objects
bool set_immutable_prototype(Object* prototype);