Created
March 14, 2014 20:34
-
-
Save goliatone/9556241 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _hasProp = {}.hasOwnProperty, | |
_inherit = function (child, parent) { | |
for (var key in parent) { | |
if (_hasProp.call(parent, key)) child[key] = parent[key]; | |
} | |
if(typeof child === 'string') child = self; | |
function ctor() { | |
this.constructor = child; | |
} | |
function self(){parent.apply(this, arguments);}; | |
ctor.prototype = parent.prototype; | |
child.prototype = new ctor(); | |
child._super = parent.prototype; | |
child.prototype.__super__ = parent; | |
return child; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment