Skip to content

Instantly share code, notes, and snippets.

@joeljackson
Created February 4, 2012 12:19
Show Gist options
  • Save joeljackson/1737506 to your computer and use it in GitHub Desktop.
Save joeljackson/1737506 to your computer and use it in GitHub Desktop.
extends
__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;
};
this.Bob = (function() {
__extends(Bob, SuperClass)
...
...
)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment