From f9395efaac11550d46ce6f73753e0cafc4519c57 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Mon, 7 Jun 2021 16:54:04 +0300 Subject: [PATCH] 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) --- Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp index 17f2a3fcb2..f6315ffb3b 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp @@ -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);