mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
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.
This commit is contained in:
parent
5ad5322f6a
commit
79958f4520
Notes:
sideshowbarker
2024-07-19 05:47:44 +09:00
Author: https://github.com/mattco98
Commit: 79958f4520
Pull-request: https://github.com/SerenityOS/serenity/pull/2489
Reviewed-by: https://github.com/awesomekling
4 changed files with 89 additions and 15 deletions
|
@ -147,7 +147,7 @@ Value ObjectConstructor::get_own_property_descriptor(Interpreter& interpreter)
|
|||
auto property_key = interpreter.argument(1).to_string(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
return object->get_own_property_descriptor(property_key);
|
||||
return object->get_own_property_descriptor_object(property_key);
|
||||
}
|
||||
|
||||
Value ObjectConstructor::define_property_(Interpreter& interpreter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue