The context for my question was Tom van Cutsem's excellent Proxy shim,
https://github.com/tvcutsem/harmony-reflect, which uses __proto__
assignment to shim Object.setPrototypeOf.  In developing Proxy code,
objects and not classes are relevant.  Directly manipulating the __proto__
is vastly superior to any solution based on es6 classes or our unfortunate
friend Object.create().

jjb


On Mon, Apr 7, 2014 at 2:34 AM, Axel Rauschmayer <[email protected]> wrote:

> I like __proto__ in object literals, as a nicer Object.create(). In that
> case, __proto__ is “the new <| operator” and really quite different from
> __proto__ as a getter and a setter.
>
> I have two uses for it:
>
> – Dict pattern { __proto__: null, ... }
> – To explain prototype chains to beginners (=> not something that would be
> used in production code).
>
> If ECMAScript 6 didn’t support classes and subclassing, it would help with
> subclassing, too.
>
>
>
>
> On Apr 7, 2014, at 11:05 , Andreas Rossberg <[email protected]> wrote:
>
> > On 4 April 2014 19:49, Allen Wirfs-Brock <[email protected]> wrote:
> >> __proto__ is there for legacy compatibility.
> >> setPrototypeOf should be preferred for new code
> >
> > For new code, neither should be used.
> >
> > /Andreas
> > _______________________________________________
> > es-discuss mailing list
> > [email protected]
> > https://mail.mozilla.org/listinfo/es-discuss
> >
>
> --
> Dr. Axel Rauschmayer
> [email protected]
>
> home: rauschma.de
> twitter: twitter.com/rauschma
> blog: 2ality.com
>
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to