setPrototypeOf vs obj.__proto__ assignment

Andrea Giammarchi andrea.giammarchi at
Mon Apr 7 11:44:47 PDT 2014

that's why it's the preferred choice ... otherwise we keep promoting and
trapping developers behind a broken pattern.

If we keep saying "just use `__proto__`" code won't ever migrate but it's
been discussed that in some case `__proto__` is a very problematic keyword.

[nashorn]( even implemented it
with the infamous dual intent, `obj["__proto__"]` vs `obj.__proto__` ,
thanks gosh [duktape](  didn't implement `__proto__` at
all and it promotes pure ES5.1 approach via `Object.create` and no hot-swap


On Mon, Apr 7, 2014 at 11:02 AM, John Barton <johnjbarton at> wrote:

> On Mon, Apr 7, 2014 at 10:51 AM, Andrea Giammarchi <
> andrea.giammarchi at> wrote:
>> ..
>> It feels like everyone uses `__proto__` on daily basis while ES6 promotes
>> classes ... so either `__proto__` is not a real world use case, or `class`
>> landed for no reason, IMO.
> You are correct, lots of code uses '__proto__', but your conclusions based
> on this make no sense.  ES6 has nothing to say about daily use until it
> ships in all relevant platforms, and the current count is zero.
> Moreover, on platforms without setPrototypeOf(), it's advantages are not
> relevant.
> jjb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list