[Webkit-unassigned] [Bug 176810] for..in on a Proxy loops over non enumerable properties

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 2 10:31:15 PDT 2018


--- Comment #12 from Caio Lima <ticaiolima at gmail.com> ---
Comment on attachment 351389
  --> https://bugs.webkit.org/attachment.cgi?id=351389
Fix for bug

View in context: https://bugs.webkit.org/attachment.cgi?id=351389&action=review

>>> Source/JavaScriptCore/runtime/ProxyObject.cpp:952
>>> +            bool isPropertyDefined = target->getOwnPropertyDescriptor(exec, ident.impl(), descriptor);
>> Is this actually what the spec says to do? This is observable behavior
> So the issue is this being called more than once basically? Because it's already called a bit further below in that method. If that's the thing then we need a way to get this information without it being user observable (or a completely different approach), yeah.

Maybe one way to check if the property is enumerable without observable behaviour is:

PropertySlot slot(target, PropertySlot::InternalMethodType::VMInquiry);
target->methodTable(vm)->getOwnPropertySlot(this, exec, ident, slot);
DefinePropertyAttributes property = DefinePropertyAttributes(slot.attributes())

std::optional<bool> maybeEnumerable  = attr.enumerable();

I'm not sure if that is the correct way to perform this check.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20181002/75444fa9/attachment-0001.html>

More information about the webkit-unassigned mailing list