Skip to content

Instantly share code, notes, and snippets.

@ryanbrubaker
Created July 10, 2012 18:54
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 ryanbrubaker/3085501 to your computer and use it in GitHub Desktop.
Save ryanbrubaker/3085501 to your computer and use it in GitHub Desktop.
CoffeeScript class utility functions
__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;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment