Object.getOwnPropertyDescriptor can return just about anything
Mark S. Miller
erights at google.com
Fri May 9 06:02:24 PDT 2014
By the same token, it is feasible to postpone these custom attributes till
ES7. My concern is that since the [[Origin]]-oriented proxy proposal that
has been in the draft spec was a distracting dead end, we should be
conservative in returning to the design that preserves the crucial
invariants. The custom attributes seem safe enough, but we have too much on
our plate and it is safer yet to postpone them. Nothing else depends on the
presence of these custom attributes being in ES6.
 My apologies once again for not paying enough attention to catch this
On Fri, May 9, 2014 at 5:23 AM, Tom Van Cutsem <tomvc.be at gmail.com> wrote:
> 2014-05-09 9:57 GMT+02:00 David Bruant <bruant.d at gmail.com>:
>> Just to try to assess the unlikelihood and understand the cases where a
>> ES5 code expectations aren't met:
>> The only case where ES6 and ES5 may diverge is for Object.getOwnPropertyDescriptor
>> where a Proxy may return something that cannot be expected from any ES5
>> The after-trap completes the property descriptor (and when completing
>> picks specifically only data or accessor property), so code that expects a
>> complete property descriptor cannot be broken.
>> However, a divergence may only occur if, for instance, the code loops
>> over the property descriptor properties or expects exactly 4 properties.
>> Is that correct or am I missing cases?
> Another possibility would be that existing client code itself extends
> property descriptors with new attributes (since descriptors returned by
> gOPD are always extensible), and can then get confused when proxies
> pre-populate these descriptors with their own custom attributes. But again,
> this is highly unlikely. I think allowing proxies to accept/return custom
> attributes remains feasible.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss