8.5.13 Proxy [[OwnPropertyKeys]]
- For [[OwnPropertyKeys]], I maintain that it's essential that this iterator at least enumerates all non-configurable own properties of the target.
Otherwise, a proxy might "hide" properties from reflective code that tries to inspect all of its properties.
Ideally, the iterator should also not enumerate any non-existent properties on a non-extensible target. Although if this invariant is violated, the invariants defined on getOwnPropertyDescriptor etc. should prevent the proxy from revealing any useful value associated with these "made-up" properties.
- As "ownPropertyKeys" returns an iterator rather than an array of strings, it's no longer symmetric to getOwnPropertyNames anyway, so I agree with the name change. However, to ensure consistency of user-facing names, either the trap should be named "ownKeys" (for consistency with Reflect.ownKeys), or Reflect.ownKeys should be renamed Reflect.ownPropertyKeys.
fixed in rev26 editor's draft
in rev26 draft