src/constructr.js
function(child, parent, protoProps, staticProps) {
    // Inherit prototype properties from parent
    // Set the prototype chain to inherit without calling parent's constructor function.
    SharedConstructor.prototype = parent.prototype;
    child.prototype = new SharedConstructor();
    child.prototype.constructor = child;

    // Extend with prototype and static properties
    extendObj(child.prototype, protoProps);
    extendObj(child, staticProps);

    // Set a convenience property in case the parent's prototype is needed later.
    child.__super__ = parent.prototype;

    // Copy references to static methods we want to extend
    child.extendWithConstructor = Constructr.extendWithConstructor;
    child.extend = Constructr.extend;
    child.mixes = Constructr.mixes;
    child.def = Constructr.def;

    return child;
}
function(child, parent, protoProps, staticProps) {
    // Inherit prototype properties from parent
    // Set the prototype chain to inherit without calling parent's constructor function.
    SharedConstructor.prototype = parent.prototype;
    child.prototype = new SharedConstructor();
    child.prototype.constructor = child;

    // Extend with prototype and static properties
    extendObj(child.prototype, protoProps);
    extendObj(child, staticProps);

    // Set a convenience property in case the parent's prototype is needed later.
    child.__super__ = parent.prototype;

    // Copy references to static methods we want to extend
    child.extendWithConstructor = Constructr.extendWithConstructor;
    child.extend = Constructr.extend;
    child.mixes = Constructr.mixes;
    child.def = Constructr.def;

    return child;
}
function ( child , parent , protoProps , staticProps ) { // Inherit prototype properties from parent // Set the prototype chain to inherit without calling parent's constructor function. SharedConstructor . prototype = parent . prototype ; child . prototype = new SharedConstructor ( ) ; child . prototype . constructor = child ; // Extend with prototype and static properties extendObj ( child . prototype , protoProps ) ; extendObj ( child , staticProps ) ; // Set a convenience property in case the parent's prototype is needed later. child . __super__ = parent . prototype ; // Copy references to static methods we want to extend child . extendWithConstructor = Constructr . extendWithConstructor ; child . extend = Constructr . extend ; child . mixes = Constructr . mixes ; child . def = Constructr . def ; return child ; }
Correctly setup the prototype chain for sub classes while optionally passing
new prototype and static properties to be mixed in with the new child
@return {Constructr}
Correctly setup the prototype chain for sub classes while optionally passing new prototype and static properties to be mixed in with the new child