The `super` keyword doesn't work as it should?

/#!/JoePea joe at trusktr.io
Thu Jul 21 04:20:02 UTC 2016


@medikoo, wow, the conversation has been going on for a long time. And in
that conversation you linked, Sean Eagan said

> I think a static |super| in light of ​ ​ES's dynamic |this| would
actually be much more​ ​surprising.  This would lead to looking for
properties in a static |super| object that may be​ ​completely unrelated to
the dynamic |this| value of a given function activation, which would​
​certainly be surprising.
>
> Consistency with other languages is valuable, but consistency with this
language (ES) is vital.  A static |super| would be inconsistent with ES's
dynamic |this|.

​I couldn't agree more.​
​
​ ​

The interesting thing is although the conversation is so old, `super` is
only just now coming out in JS engines. I only just now discovered this
undesirable behavior because ES6 only just now became reality.

Is there any hard evidence of the performance cost of a dynamic super? So
far I've read in various places (for example the thread linked to by
@medikoo, Axel's 2ality article on super) about there being "overhead", but
the articles haven't quantified or put into perspective the actual
performance cost. Is it really that bad?

*/#!/*JoePea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160720/35ef31e9/attachment.html>


More information about the es-discuss mailing list