mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
CoffeeScript 0.9.2
This commit is contained in:
parent
bd3471b3d1
commit
e2c46d14f0
27 changed files with 519 additions and 417 deletions
|
@ -5,7 +5,7 @@ var __extends = function(child, parent) {
|
|||
child.prototype = new ctor();
|
||||
child.prototype.constructor = child;
|
||||
if (typeof parent.extended === "function") parent.extended(child);
|
||||
child.__superClass__ = parent.prototype;
|
||||
child.__super__ = parent.prototype;
|
||||
};
|
||||
Animal = function(_a) {
|
||||
this.name = _a;
|
||||
|
@ -20,7 +20,7 @@ Snake = function() {
|
|||
__extends(Snake, Animal);
|
||||
Snake.prototype.move = function() {
|
||||
alert("Slithering...");
|
||||
return Snake.__superClass__.move.call(this, 5);
|
||||
return Snake.__super__.move.call(this, 5);
|
||||
};
|
||||
Horse = function() {
|
||||
return Animal.apply(this, arguments);
|
||||
|
@ -28,7 +28,7 @@ Horse = function() {
|
|||
__extends(Horse, Animal);
|
||||
Horse.prototype.move = function() {
|
||||
alert("Galloping...");
|
||||
return Horse.__superClass__.move.call(this, 45);
|
||||
return Horse.__super__.move.call(this, 45);
|
||||
};
|
||||
sam = new Snake("Sammy the Python");
|
||||
tom = new Horse("Tommy the Palomino");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue