Detect CoffeeScript with generated comment

This commit is contained in:
Joshua Peek
2012-01-16 16:57:30 -06:00
parent 946357fde7
commit 7974d23444
6 changed files with 146 additions and 25 deletions

View File

@@ -1,46 +1,69 @@
// Generated by CoffeeScript 1.2.1
(function() {
var Animal, Horse, Snake, sam, tom;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
var Animal, Horse, Snake, sam, tom,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
Animal = (function() {
Animal.name = 'Animal';
function Animal(name) {
this.name = name;
}
Animal.prototype.move = function(meters) {
return alert(this.name + " moved " + meters + "m.");
};
return Animal;
})();
Snake = (function() {
__extends(Snake, Animal);
Snake = (function(_super) {
__extends(Snake, _super);
Snake.name = 'Snake';
function Snake() {
Snake.__super__.constructor.apply(this, arguments);
return Snake.__super__.constructor.apply(this, arguments);
}
Snake.prototype.move = function() {
alert("Slithering...");
return Snake.__super__.move.call(this, 5);
};
return Snake;
})();
Horse = (function() {
__extends(Horse, Animal);
})(Animal);
Horse = (function(_super) {
__extends(Horse, _super);
Horse.name = 'Horse';
function Horse() {
Horse.__super__.constructor.apply(this, arguments);
return Horse.__super__.constructor.apply(this, arguments);
}
Horse.prototype.move = function() {
alert("Galloping...");
return Horse.__super__.move.call(this, 45);
};
return Horse;
})();
})(Animal);
sam = new Snake("Sammy the Python");
tom = new Horse("Tommy the Palomino");
sam.move();
tom.move();
}).call(this);