Javascript multiple inheritance pattern
<p>I have used this pattern for inheritance in JS</p>

<pre><code>MyApp.utils = {
    extend: function (subClass, baseClass, subClassMethods) {
        function inheritance() { }
        inheritance.prototype = baseClass.prototype;
        subClass.prototype = new inheritance();
        subClass.prototype.constructor = subClass;
        subClass.baseConstructor = baseClass;
        subClass.superClass = baseClass.prototype;

        if (subClassMethods == null) return;

        for (var index in subClassMethods) {
            subClass.prototype[index] = subClassMethods[index];
        }
    }
};
</code></pre>

<p>You use it like </p>

<pre><code>MyApp.utils.extend(SubClass, BaseClass, {
    subMethodOne: function() {        
    }
});
</code></pre>

<p>This have worked nicely and the code is pretty straight forward, but it does not work with multiple inheritance because the constructor call will be to the subclass instead of baseclass and that will create a stack overflow</p>

<p>WHat is the best pattern for multiple inheritance? It must support prototype and that separate constructor logic in each class</p>

<p>JSFiddle: <a href="http://jsfiddle.net/HcPhL/1/" rel="nofollow">http://jsfiddle.net/HcPhL/1/</a>
It will crash FF so beware :D</p>
