summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/ReflectObject.cpp
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2020-06-03 09:40:17 -0700
committerAndreas Kling <kling@serenityos.org>2020-06-06 22:13:01 +0200
commit79958f45204fc386ecc09a68b2ee46f785c4bca4 (patch)
tree8ef2c1d279ddafc01c366dc3fbd05ff741cc1505 /Libraries/LibJS/Runtime/ReflectObject.cpp
parent5ad5322f6a1f9119e676ea74499ec6d19b085047 (diff)
downloadserenity-79958f45204fc386ecc09a68b2ee46f785c4bca4.zip
LibJS: Add PropertyDescriptor object
This new struct is now returned from get_own_property_descriptor. To preserve the old functionality of returning an object, there is now a get_own_property_descriptor_object method, for use in {Object,Reflect}.getOwnPropertyDescriptor(). This change will be useful for the implementation of Proxies, which do a lot of descriptor checks. We want to avoid as many object gets and puts as possible.
Diffstat (limited to 'Libraries/LibJS/Runtime/ReflectObject.cpp')
-rw-r--r--Libraries/LibJS/Runtime/ReflectObject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibJS/Runtime/ReflectObject.cpp b/Libraries/LibJS/Runtime/ReflectObject.cpp
index 2a10fce38e..c81ba0fea2 100644
--- a/Libraries/LibJS/Runtime/ReflectObject.cpp
+++ b/Libraries/LibJS/Runtime/ReflectObject.cpp
@@ -189,7 +189,7 @@ Value ReflectObject::get_own_property_descriptor(Interpreter& interpreter)
auto property_key = interpreter.argument(1).to_string(interpreter);
if (interpreter.exception())
return {};
- return target->get_own_property_descriptor(property_key);
+ return target->get_own_property_descriptor_object(property_key);
}
Value ReflectObject::get_prototype_of(Interpreter& interpreter)