Created
January 6, 2012 16:29
-
-
Save private-face/1571303 to your computer and use it in GitHub Desktop.
Extend
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
function extend(child, parent, /*optional*/ prototype) { | |
var F = function() {}; | |
F.prototype = parent.prototype; | |
child.prototype = new F(); | |
child.prototype.constructor = child; | |
child._super = parent.prototype; | |
if (prototype) { | |
$.extend(child.prototype, prototype); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment