got extends back in the language -- use it together with super

This commit is contained in:
Jeremy Ashkenas
2009-12-24 16:49:23 -08:00
parent 47812d9ea6
commit 1c83e68292
10 changed files with 62 additions and 38 deletions

View File

@@ -3,13 +3,13 @@ Animal.prototype.move: meters =>
alert(this.name + " moved " + meters + "m.").
Snake: name => this.name: name.
Snake.prototype: new Animal()
Snake extends new Animal()
Snake.prototype.move: =>
alert("Slithering...")
super(5).
Horse: name => this.name: name.
Horse.prototype: new Animal()
Horse extends new Animal()
Horse.prototype.move: =>
alert("Galloping...")
super(45).