July TC39 meeting notes, day 1

Andreas Rossberg rossberg at google.com
Fri Aug 12 05:23:14 PDT 2011


On 12 August 2011 13:53, Tom Van Cutsem <tomvc.be at gmail.com> wrote:
> I think I found a compelling and easy-to-understand
> rule for determining whether or not a trap needs access to proxy/receiver:
> if the trap deals with inherited properties, it needs access to |proxy|.
>
> Using that rule, the following traps require access to |proxy|:
> get, set, getPropertyDescriptor, getPropertyNames, has, enumerate
> (incidentally, all of these traps are or can be made derived)
>
> All other traps deal only with "own" properties, and do not need |proxy|:
> getOwnPropertyDescriptor, getOwnPropertyNames, defineProperty, delete, fix,
> hasOwn, keys

Although that rule seems fairly simple, I still find a half/half
situation unnecessarily confusing and error-prone. I would strongly
vote for making the API consistent. That is, either equip all methods
with a proxy argument (preferably as first), or none.

/Andreas


More information about the es-discuss mailing list