mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibJS: Use ToPropertyKey in Object.getOwnPropertyDescriptor
The specification requires this. (And the current usage of PropertyName::from_value is invalid since integers are not allowed in this context)
This commit is contained in:
parent
1c51edb639
commit
f9395efaac
Notes:
sideshowbarker
2024-07-18 12:42:55 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/f9395efaac1 Pull-request: https://github.com/SerenityOS/serenity/pull/7877 Reviewed-by: https://github.com/linusg
@ -190,7 +190,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::get_own_property_descriptor)
|
||||
auto* object = vm.argument(0).to_object(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto property_key = PropertyName::from_value(global_object, vm.argument(1));
|
||||
auto property_key = vm.argument(1).to_property_key(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
return object->get_own_property_descriptor_object(property_key);
|
||||
|
Loading…
Reference in New Issue
Block a user