Making "super" work outside a literal?

Axel Rauschmayer axel at rauschma.de
Thu Jun 23 12:07:33 PDT 2011


>> I believe you about the dynamic super. I can summarize my question as follows:
>> - Making "super" or "current object" available to a function incurs costs.
> 
> These are two separate costs. You didn't define which 'super' but from context I'll assume static. That's a function-creation-time internal property setting cost.
> 
> If by "current object" you mean |here|, please use that term for clarity's sake. That has a per-call cost: an extra implicit parameter. We've been over this about five times.

Yes, I’m not questioning, just repeating and agreeing. And comparing the cost of |here| to the cost |thisFunction|.

>> - Making "current function" available to a function does not incur costs? This is *not* an extra parameter, then?
> 
> Do you mean "current object", aka |here|?
> 
> If so, that's an extra parameter.
> 
> If not, I don't know what you mean.


Static super can only be accessed if you have a reference |thisFunction| to the function that is currently executed. I would think that  |thisFunction| would also incur costs, but Allen has since said that these costs are negligible.


Related topic: How would |super| be handled if |this| is lexical?

-- 
Dr. Axel Rauschmayer

axel at rauschma.de
twitter.com/rauschma

home: rauschma.de
blog: 2ality.com





More information about the es-discuss mailing list