From de10f0dc6c20928fc1daa339e0b73aeb2d05367a Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 5 Jun 2021 15:23:03 +0300 Subject: [PATCH] LibJS: Support symbol keys in Object.prototype.propertyIsEnumerable --- Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp index d00de438c4..ba7a7e166a 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp @@ -111,13 +111,13 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectPrototype::value_of) JS_DEFINE_NATIVE_FUNCTION(ObjectPrototype::property_is_enumerable) { - auto name = vm.argument(0).to_string(global_object); + auto property_key = vm.argument(0).to_property_key(global_object); if (vm.exception()) return {}; auto* this_object = vm.this_value(global_object).to_object(global_object); if (!this_object) return {}; - auto property_descriptor = this_object->get_own_property_descriptor(name); + auto property_descriptor = this_object->get_own_property_descriptor(property_key); if (!property_descriptor.has_value()) return Value(false); return Value(property_descriptor.value().attributes.is_enumerable());