Minimalist Classes

Jake Verbaten raynos2 at gmail.com
Tue Nov 1 10:30:02 PDT 2011


>
>
> Why isn't the |super| lookup-point |this.getPrototypeOf()|
>
>
Assume |super| is |this.getPrototypeOf()|

Let F be a "class", let f be an instance of the class.

inside f you have access to a method defined on F.

If you call a method defined on F from f and that method calls super, you
would be invoking getPrototypeOf(this) which is just F (since this is f,
and the prototype of f is F). So you would then end up calling the same
method again and recurse endlessly.

Basically because you apply methods with a value of this then if super were
tied to this you would get infinite super recursion if you chained super
calls.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111101/1ab520a6/attachment-0001.html>


More information about the es-discuss mailing list