extending an ES6 class using ES5 syntax?

Jason Orendorff jason.orendorff at gmail.com
Mon May 16 16:57:16 UTC 2016

On Sun, May 15, 2016 at 3:07 AM, Andrea Giammarchi
<andrea.giammarchi at gmail.com> wrote:
> Thanks Andy, I think that bug has exact same concerns and valid answers for
> Boris too. Here it's also the only valid option to properly extend classes
> in ES5 and I can't wait for such "warning" to go away, most developers have
> been scared by the same warning by my `document.registerElement` polyfill
> but there's no other way, hence my complain.

This is another reason we killed the warning - for a lot of polyfills
there is just no other way to get the desired behavior.

Another reason - the cases where setting an object's prototype was the
right thing to do were disproportionately cases that affect library
authors, but then it's mainly the library *users* who see console
warnings. So the warning was not even being shown to the right people.

> FF should probably stop wasting
> time warning about what devs should do or not, if devs are using
> standardized practices. Deprecation is OK, scary messages without details
> are just ...yak.

Right, this is another reason we killed the warning - the way it was
worded was pointlessly scary.

In other words, we agree completely, and that's why we killed the warning.

That said, it remains true that changing an object's prototype kind of
fundamentally interferes with techniques which all fast ES
implementations use to optimize property/method access. The warning is
going away. The situation it is warning about is not going away.


More information about the es-discuss mailing list