Making "super" work outside a literal?

Brendan Eich brendan at mozilla.com
Sun Jun 19 21:04:03 PDT 2011


On Jun 19, 2011, at 7:32 PM, Axel Rauschmayer wrote:

>>> I don’t know how problematic this would be, but if "super" is an internal property of a function, then it could be updated whenever such a function is set as the value of a property.
>> 
>> No, that doesn't work. Both for cases where the function author really did mean the proto-object of the literal-induced object surrounding the function, and in efficiency terms (we do not mutate the RHS of assignment depending on the LHS's Reference Base, e.g.).
>> 
>> If you really want to change what super means in a function expressed in an object initialiser, I'd like to see the exact use-case.
> 
> The only use case would be assigning a function that uses "super" to a property.

Such an assignment might need the meaning of super to remain the same, though. What's the use-case for remapping it? Stealing methods from one class to another whose static super is not the same object as the proto of the object into which the stolen function reference is stored?

/be


More information about the es-discuss mailing list