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 ada8dfc6d4
commit a71de4b5b6
11 changed files with 1078 additions and 1017 deletions

View File

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