Re:CoffeeScript, a little language that compiles to JavaScri...
by vr on Friday December 25, 2009 @03:26AM
(#1014865)
It seems you should use "Horse extends Animal.prototype" in your examples or just make "Horse extends Animal" compile to "Horse.prototype.__proto__ = Animal.prototype". Also a subclass constructor should call the one of the superclass. Otherwise, a single Animal instance is shared by all subclass instances and for no reason Animal is created simply to declare a subclass.
[ Parent
| on HN ]
There are no comments on this comment yet.