extending an ES6 class using ES5 syntax?

Andrea Giammarchi andrea.giammarchi at gmail.com
Mon May 16 17:04:55 UTC 2016

It's funny, if you think that the entire story of `__proto__` is because
Zepto library was using and not willing to ditch the conversion of
`document.querySelectorAll('css')` results as `Array` via `__proto__` ...
and only because that was way faster than an
`Array.prototype.slice.call(document.querySelectorAll('css'))` alternative

ECMAScript standardized a practice used to improve performance on
developers side ... turns out, that was rather Harakiri for performance

Hilarious, I hope we all learned something about it (but unfortunately I'm
sure we didn't)

Best Regards

On Mon, May 16, 2016 at 5:57 PM, Jason Orendorff <jason.orendorff at gmail.com>

> 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.
> -j
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160516/42c4f6cd/attachment.html>

More information about the es-discuss mailing list