js/core/Bindable.js
function (attribute, key) {
                    if (this.inject && this.inject.hasOwnProperty(key)) {
                        return attribute;
                    } else if (attribute instanceof Bindable) {
                        return attribute.clone();
                    } else if (attribute && (attribute.clone instanceof Function)) {
                        return attribute.clone();
                    } else if (_.isArray(attribute)) {
                        var retArray = [];
                        for (var i = 0; i < attribute.length; i++) {
                            retArray.push(this._cloneAttribute(attribute[i]));
                        }
                        return retArray;
                    } else if (attribute instanceof Date) {
                        return new Date(attribute.getTime());
                    } else if (_.isObject(attribute)) {
                        var retObject = {};
                        for (var attrKey in attribute) {
                            if (attribute.hasOwnProperty(attrKey)) {
                                retObject[attrKey] = this._cloneAttribute(attribute[attrKey], attrKey);
                            }
                        }
                        return retObject;
                    } else {
                        return attribute;
                    }
                }
function (attribute, key) {
                    if (this.inject && this.inject.hasOwnProperty(key)) {
                        return attribute;
                    } else if (attribute instanceof Bindable) {
                        return attribute.clone();
                    } else if (attribute && (attribute.clone instanceof Function)) {
                        return attribute.clone();
                    } else if (_.isArray(attribute)) {
                        var retArray = [];
                        for (var i = 0; i < attribute.length; i++) {
                            retArray.push(this._cloneAttribute(attribute[i]));
                        }
                        return retArray;
                    } else if (attribute instanceof Date) {
                        return new Date(attribute.getTime());
                    } else if (_.isObject(attribute)) {
                        var retObject = {};
                        for (var attrKey in attribute) {
                            if (attribute.hasOwnProperty(attrKey)) {
                                retObject[attrKey] = this._cloneAttribute(attribute[attrKey], attrKey);
                            }
                        }
                        return retObject;
                    } else {
                        return attribute;
                    }
                }
function ( attribute , key ) { if ( this . inject && this . inject . hasOwnProperty ( key ) ) { return attribute ; } else if ( attribute instanceof Bindable ) { return attribute . clone ( ) ; } else if ( attribute && ( attribute . clone instanceof Function ) ) { return attribute . clone ( ) ; } else if ( _ . isArray ( attribute ) ) { var retArray = [ ] ; for ( var i = 0 ; i < attribute . length ; i ++ ) { retArray . push ( this . _cloneAttribute ( attribute [ i ] ) ) ; } return retArray ; } else if ( attribute instanceof Date ) { return new Date ( attribute . getTime ( ) ) ; } else if ( _ . isObject ( attribute ) ) { var retObject = { } ; for ( var attrKey in attribute ) { if ( attribute . hasOwnProperty ( attrKey ) ) { retObject [ attrKey ] = this . _cloneAttribute ( attribute [ attrKey ] , attrKey ) ; } } return retObject ; } else { return attribute ; } }
Returns a copy of the attribute. This method is a hook for further cloning options
@param attribute
@param key
@private
Returns a copy of the attribute . This method is a hook for further cloning options