mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
adding '::' as shorthand for '.prototype.'
This commit is contained in:
@@ -141,18 +141,18 @@ aliquam erat volutpat. Ut wisi enim ad."
|
||||
|
||||
# Inheritance and calling super.
|
||||
Animal: =>
|
||||
Animal.prototype.move: meters =>
|
||||
Animal::move: meters =>
|
||||
alert(this.name + " moved " + meters + "m.")
|
||||
|
||||
Snake: name => this.name: name
|
||||
Snake extends Animal
|
||||
Snake.prototype.move: =>
|
||||
Snake::move: =>
|
||||
alert('Slithering...')
|
||||
super(5)
|
||||
|
||||
Horse: name => this.name: name
|
||||
Horse extends Animal
|
||||
Horse.prototype.move: =>
|
||||
Horse::move: =>
|
||||
alert('Galloping...')
|
||||
super(45)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user