On __proto__ as a magical data property

Tom Van Cutsem tomvc.be at gmail.com
Thu Jul 19 02:18:22 PDT 2012


2012/7/19 David Bruant <bruant.d at gmail.com>

>  I agree with that vision and it is making me realize that we only need a
> setPrototypeOf trap if the setter is extractable. If __proto__ is a data
> property, the existing traps are enough.
> This probably weighs in favor of __proto__ as a data property.
>

Well, it's true we don't need setPrototypeOf if we don't have a __proto__
setter, but I don't think that counts against __proto__-as-accessor. Proxy
authors would still need to special-case on the string "__proto__" in the
"set" trap, for instance, if they want to mimic the expected behavior. In
that sense a setPrototypeOf trap would actually be cleaner.

Cheers,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120719/a732ea9f/attachment.html>


More information about the es-discuss mailing list