Skip to content

Instantly share code, notes, and snippets.

@weepy
Created August 30, 2011 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weepy/1180503 to your computer and use it in GitHub Desktop.
Save weepy/1180503 to your computer and use it in GitHub Desktop.
CoffeeScript with named utility functions
var Animal, Snake;
var __hasProp = Object.prototype.hasOwnProperty;
Animal = (function() {
function Animal() {}
return Animal;
})();
Snake = (function() {
__extends(Snake, Animal);
function Snake() {
Snake.__super__.constructor.apply(this, arguments);
}
return Snake;
})();
function __extends(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;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment