Making "super" work outside a literal?

Brendan Eich brendan at mozilla.com
Wed Jun 22 08:35:37 PDT 2011


On Jun 22, 2011, at 8:28 AM, Sean Eagan wrote:

> On Wed, Jun 22, 2011 at 10:01 AM, Brendan Eich <brendan at mozilla.com> wrote:
>> On Jun 22, 2011, at 6:48 AM, Sean Eagan wrote:
>> 
>>> I don't think we need any "safety check" when assigning a method or
>>> accessor getter or setter that uses super to an object.  The concept
>>> of "super" seems to be a relative one,
>> 
>> That is what we are arguing about. It's not a conclusion we all share.
> 
> In ES, functions are first class objects not owned by any one object,
> an "absolute" super breaks this.

Functions have static scope (see the [[Scope]] internal property). This is absolute and with very good reason!


>> The "current object" -- Axel's |here| -- is not exposed in JS. Exposing it requires another implicit parameter, which costs too much.
> 
> I'm not suggesting that |here| be exposed just |super|.

Your proposal requires another (implicit) parameter to functions taking super.

Since we do not know at the call site whether a function takes super, it requires an extra parameter for every call. This costs too much.

/be



More information about the es-discuss mailing list