4 ms·
I think they mean that you can't set multiple prototypes, and there's no way to capture calls to "obj.something_undefined" values or methods, so you have to cop
by Groxx 15y ago
I think they mean that you can't set multiple prototypes, and there's no way to capture calls to "obj.something_undefined" values or methods, so you have to copy the interfaces of anything you wish to mix in. Which means breaking prototypical inheritance with your mixins - they can't change, because anything set up by such copying won't get updated.
Specific quote my reasoning is based on: ... changes to the mixin affect objects that have already been extended.
edit: well... you could. By making mixin objects that propagate changes to themselves to instances of things which include them - pass each instance to the mixin, and keep a list. But that'd end up making your entire program into one big memory leak, unless you want to go down the constructor/destructor and manual memory management route in JS. I doubt it's worth it.