lib/kissy/5.0.0-alpha.3/build/attribute-debug.js
function (name, attrConfig, override) {
            var self = this, attrs = self.getAttrs(), attr,
                // shadow clone
                cfg = util.merge(attrConfig);
            if (cfg.value && typeof cfg.value === 'object') {
                cfg.value = util.clone(cfg.value);
                LoggerManger.log('please use valueFn instead of value for ' + name + ' attribute', 'warn');
            }
            if (attr = attrs[name]) {
                util.mix(attr, cfg, override);
            } else {
                attrs[name] = cfg;
            }
            return self;
        }
function (name, attrConfig, override) {
            var self = this, attrs = self.getAttrs(), attr,
                // shadow clone
                cfg = util.merge(attrConfig);
            if (cfg.value && typeof cfg.value === 'object') {
                cfg.value = util.clone(cfg.value);
                LoggerManger.log('please use valueFn instead of value for ' + name + ' attribute', 'warn');
            }
            if (attr = attrs[name]) {
                util.mix(attr, cfg, override);
            } else {
                attrs[name] = cfg;
            }
            return self;
        }
function ( name , attrConfig , override ) { var self = this , attrs = self . getAttrs ( ) , attr , // shadow clone cfg = util . merge ( attrConfig ) ; if ( cfg . value && typeof cfg . value === 'object' ) { cfg . value = util . clone ( cfg . value ) ; LoggerManger . log ( 'please use valueFn instead of value for ' + name + ' attribute' , 'warn' ) ; } if ( attr = attrs [ name ] ) { util . mix ( attr , cfg , override ) ; } else { attrs [ name ] = cfg ; } return self ; }
Adds an attribute with the provided configuration to the host object.
@param {String} name attrName
@param {Object} attrConfig The config supports the following properties
@param [attrConfig.value] simple object or system native object
@param [attrConfig.valueFn] a function which can return current attribute 's default value
@param {Function} [attrConfig.setter] call when set attribute 's value
pass current attribute 's value as parameter
if return value is not undefined,set returned value as real value
@param {Function} [attrConfig.getter] call when get attribute 's value
pass current attribute 's value as parameter
return getter's returned value to invoker
@param {Function} [attrConfig.validator]  call before set attribute 's value
if return false,cancel this set action
@param {Boolean} [override] whether override existing attribute config ,default true
@chainable
Adds an attribute with the provided configuration to the host object .