do we have a thisclass? (for abstract static methods)

Axel Rauschmayer axel at rauschma.de
Fri Jun 7 08:37:18 PDT 2013


> On Thu, Jun 6, 2013 at 2:12 PM, Claus Reinke <claus.reinke at talk21.com> wrote:
> We do have this/super for references along the instance prototype
> chain, and we have this.constructor for getting to the class of an instance
> method. But what about getting the current class from a static method,
> for class-side inheritance?
> 
> Can't you just use "this"?

Exactly, that should work. The constructors form their own prototype chain (somewhat independently of the instance prototypes, but reflecting their chain), so everything should work out. In other words, Sub is just an object, so its methods can use `this` to refer to each other.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130607/c261845b/attachment-0001.html>


More information about the es-discuss mailing list