mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:07:34 +00:00
LibJS: Support symbol keys in Object.prototype.propertyIsEnumerable
This commit is contained in:
parent
eb0b1c432a
commit
de10f0dc6c
1 changed files with 2 additions and 2 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue