I try to write a mix-in function for JavaScript. The easy part is to copy the prototype. The complicate part is the constructor call.
For example I have the following