[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 Jan 22 09:00:33 PST 2019
https://bugs.webkit.org/show_bug.cgi?id=176810
Caitlin Potter (:caitp) <caitp at igalia.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |caitp at igalia.com
--- Comment #18 from Caitlin Potter (:caitp) <caitp at igalia.com> ---
So there are a few issues at the moment.
The spec compliant fix for this particular issue, would be to filter the PropertyNameArray after getOwnPropertyNames() is completed. This ensures that it doesn't interfere with the invariant validation at the end.
There are a few other compliance issues, which are maybe less of an issue:
Duplicate property names. Currently, PropertyNameArray does not account for duplicates. Unfortunately, in the case of ProxyObject, duplicates are observable. However, there would be a performance penalty if PropertyNameArray were changed to support duplicates for all JSCell types --- So probably the thing to do is special case `getOwnPropertyNames` for ProxyObjects where needed.
There's a third failure in the WPT regression, which I believe is related to JSDOMConvertRecord not handling Symbol-named properties, which the test seems to expect. This looks like it should be simple enough to fix with
```diff
- JSC::PropertyNameArray keys(&vm, JSC::PropertyNameMode::Strings, JSC::PrivateSymbolMode::Exclude);
+ JSC::PropertyNameArray keys(&vm, JSC::PropertyNameMode::StringsAndSymbols, JSC::PrivateSymbolMode::Exclude);
object->methodTable(vm)->getOwnPropertyNames(object, &state, keys, JSC::EnumerationMode());
```
---
So, I'm happy to provide fixes for 0-3 of these problems, but it's important to keep in mind that each one very likely will negatively impact performance in some way, for the sake of improved spec compliance in less common cases.
--
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/20190122/43ba5506/attachment.html>
More information about the webkit-unassigned
mailing list