src/pyjamas.js
/**
     * Checks if the given value is an instance of the constructor.
     * If so then returns the value, otherwise it returns a new
     * instance of the constructor
     *
     * @param constructor   {function}  Object constructor
     * @param value         {*}         Instance of constructor or nothing
     * @param defers        {Array}     Constructors to defer execution
     *
     * @return {*} An instance of the constructor
     * @private
     */
Checks if the given value is an instance of the constructor.
If so then returns the value, otherwise it returns a new
instance of the constructor

@param constructor   {function}  Object constructor
@param value         {*}         Instance of constructor or nothing
@param defers        {Array}     Constructors to defer execution

@return {*} An instance of the constructor
@private
Checks if the given value is an instance of the constructor . If so then returns the value otherwise it returns a new instance of the constructor @param constructor { function } Object constructor @param value { * } Instance of constructor or nothing @param defers { Array } Constructors to defer execution @return { * } An instance of the constructor @private
function construct (constructor, value, defers) {
        if ('function' === typeof constructor) {
            if (getConstructor(value) === constructor) {
                return value;
            } else if (defers.indexOf(constructor) < 0) {
                return new constructor(); 
            } else {
                return merge(Object.create(constructor.prototype), value);
            }
        }
        return value;
    }
function construct ( constructor , value , defers ) { if ( 'function' === typeof constructor ) { if ( getConstructor ( value ) === constructor ) { return value ; } else if ( defers . indexOf ( constructor ) < 0 ) { return new constructor ( ) ; } else { return merge ( Object . create ( constructor . prototype ) , value ) ; } } return value ; }
Checks if the given value is an instance of the constructor.
Checks if the given value is an instance of the constructor .
// jshint ignore : line