mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
removing object comprehensions from CoffeeScript, they were necessitating the generation of too much ugly JS
This commit is contained in:
parent
8ea75290b5
commit
13fc8aea04
14 changed files with 128 additions and 211 deletions
|
@ -1,5 +1,5 @@
|
|||
(function(){
|
||||
var Animal, Horse, Snake, sam, tom;
|
||||
var Animal, Horse, Snake, __a, __b, sam, tom;
|
||||
Animal = function Animal() {
|
||||
};
|
||||
Animal.prototype.move = function move(meters) {
|
||||
|
@ -10,20 +10,24 @@
|
|||
__a = this.name = name;
|
||||
return Snake === this.constructor ? this : __a;
|
||||
};
|
||||
__a = function(){};
|
||||
__a.prototype = Animal.prototype;
|
||||
Snake.__superClass__ = Animal.prototype;
|
||||
Snake.prototype = new Animal();
|
||||
Snake.prototype = new __a();
|
||||
Snake.prototype.constructor = Snake;
|
||||
Snake.prototype.move = function move() {
|
||||
alert("Slithering...");
|
||||
return Snake.__superClass__.move.call(this, 5);
|
||||
};
|
||||
Horse = function Horse(name) {
|
||||
var __a;
|
||||
__a = this.name = name;
|
||||
return Horse === this.constructor ? this : __a;
|
||||
var __b;
|
||||
__b = this.name = name;
|
||||
return Horse === this.constructor ? this : __b;
|
||||
};
|
||||
__b = function(){};
|
||||
__b.prototype = Animal.prototype;
|
||||
Horse.__superClass__ = Animal.prototype;
|
||||
Horse.prototype = new Animal();
|
||||
Horse.prototype = new __b();
|
||||
Horse.prototype.constructor = Horse;
|
||||
Horse.prototype.move = function move() {
|
||||
alert("Galloping...");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue