Skip to content

Instantly share code, notes, and snippets.

@gish
Created April 22, 2014 15:07
Show Gist options
  • Save gish/11182858 to your computer and use it in GitHub Desktop.
Save gish/11182858 to your computer and use it in GitHub Desktop.
var Child, Person,
__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;
};
Person = (function () {
Person.name = 'Person';
function Person() {}
return Person;
})();
Child = (function (_super) {
__extends(Child, _super);
Child.name = 'Child';
function Child() {
return Child.__super__.constructor.apply(this, arguments);
}
return Child;
})(Person);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment