Minimalist Classes

Axel Rauschmayer axel at
Tue Nov 1 12:21:34 PDT 2011

> Invocation: should return "BA". With your library I would expect it to return "BBA".
> Yes, it would. That's a good tricky case. I'm not sure if extra bookkeeping could make sense of that call, as there isn't any information as to where the function fits in to obj's prototype chain -- or if it's part of another prototype chain entirely. I'd like to hope that something could be figured out, but another alternative is for super() within a direct call() or apply() to be an error.

Another problem: What if an instance method makes a super-call?

A slightly less elegant (and performant) variant of your solution that works in both of the above cases is:

- Keep track (per object and method) of the object where the previous super-call (e.g. ended up.

- Start your search either there or at |this|: look for the *second* occurrence of property "foo". [optional: optimize non-|this| case]

Dr. Axel Rauschmayer
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list