Making "super" work outside a literal?

Brendan Eich brendan at mozilla.com
Wed Jun 22 12:11:31 PDT 2011


On Jun 22, 2011, at 11:01 AM, Sean Eagan wrote:

> On Wed, Jun 22, 2011 at 12:07 PM, Juan Ignacio Dopazo
> <dopazo.juan at gmail.com> wrote:
>> Can the value of a dynamic super be unambiguously resolved with prototype
>> climbing and without an extra implicit parameter?
> 
> Yes, it can be unambiguously determined by prototype climbing, the
> only information from the call site that is used is the base ( |this|
> ) value of the method call or accessor property access, whose
> prototype chain is the one that is climbed.

I hope you aren't proposing lazy re-climbing on the first or all evaluations of 'super'. That will not work. The actual 'here' or "method home" found during callee evaluation must be used. You cannot assume prototype lookup is idempotent.

/be



More information about the es-discuss mailing list