Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.