Created
August 26, 2016 06:42
-
-
Save kirkouimet/856492387755f34800759bef2661355f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
implement = function(classToReceiveImplementation, classToImplement) { | |
for(var classToImplementProperty in classToImplement) { | |
if(classToReceiveImplementation[classToImplementProperty] === undefined) { | |
//console.log(classToImplementProperty, 'does not exist on class, copying'); | |
classToReceiveImplementation[classToImplementProperty] = cloneProperty(classToImplement[classToImplementProperty]); | |
} | |
} | |
for(var classToImplementPrototypeProperty in classToImplement.prototype) { | |
if(classToReceiveImplementation.prototype[classToImplementPrototypeProperty] === undefined) { | |
//console.log(classToImplementPrototypeProperty, 'does not exist on class prototype, copying'); | |
classToReceiveImplementation.prototype[classToImplementPrototypeProperty] = cloneProperty(classToImplement.prototype[classToImplementPrototypeProperty]); | |
} | |
} | |
return classToReceiveImplementation; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment