mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 19:34:27 -05:00
removed all traces of 'extends' -- it's not any shorter or more convenient than just setting the prototype
This commit is contained in:
@@ -3,13 +3,13 @@ Animal.prototype.move: meters =>
|
||||
alert(this.name + " moved " + meters + "m.").
|
||||
|
||||
Snake: name => this.name: name.
|
||||
Snake extends new Animal()
|
||||
Snake.prototype: new Animal()
|
||||
Snake.prototype.move: =>
|
||||
alert("Slithering...")
|
||||
super(5).
|
||||
|
||||
Horse: name => this.name: name.
|
||||
Horse extends new Animal()
|
||||
Horse.prototype: new Animal()
|
||||
Horse.prototype.move: =>
|
||||
alert("Galloping...")
|
||||
super(45).
|
||||
|
||||
Reference in New Issue
Block a user