src/components/meta/Properties.js
function(fields, newValue, oldValue, wasExists) {
            fields = this.__resolveFields(fields);

            var prop, event, key, i, ii;

            this.__checkEmitEvent(true);

            var isEqual = true;

            if (_.isSimpleObject(newValue) && _.isSimpleObject(oldValue)) {
                for (key in oldValue) {
                    if (newValue[key] !== oldValue[key]) {
                        isEqual = false;
                        break;
                    }
                }
            }
            else if (_.isArray(newValue) && _.isArray(oldValue)) {
                for (i = 0, ii = oldValue.length; i < ii; ++i) {
                    if (newValue[i] !== oldValue[i]) {
                        isEqual = false;
                        break;
                    }
                }
            }
            else if (newValue !== oldValue) {
                isEqual = false;
            }

            if (!isEqual) {
                prop  = fields.join('.');

                this.__emitEvent('property.' + prop + '.' + 'set', newValue, oldValue);
                this.__emitEvent('property.set', prop, newValue, oldValue);

                if (fields.length && !wasExists) {
                    prop  = fields.slice(0,-1).join('.');
                    key   = _.last(fields);

                    this.__emitEvent('property.' + prop + '.item_added', key, newValue);
                    this.__emitEvent('property.item_added', prop, key, newValue);
                }
            }

            return this;
        }
function(fields, newValue, oldValue, wasExists) {
            fields = this.__resolveFields(fields);

            var prop, event, key, i, ii;

            this.__checkEmitEvent(true);

            var isEqual = true;

            if (_.isSimpleObject(newValue) && _.isSimpleObject(oldValue)) {
                for (key in oldValue) {
                    if (newValue[key] !== oldValue[key]) {
                        isEqual = false;
                        break;
                    }
                }
            }
            else if (_.isArray(newValue) && _.isArray(oldValue)) {
                for (i = 0, ii = oldValue.length; i < ii; ++i) {
                    if (newValue[i] !== oldValue[i]) {
                        isEqual = false;
                        break;
                    }
                }
            }
            else if (newValue !== oldValue) {
                isEqual = false;
            }

            if (!isEqual) {
                prop  = fields.join('.');

                this.__emitEvent('property.' + prop + '.' + 'set', newValue, oldValue);
                this.__emitEvent('property.set', prop, newValue, oldValue);

                if (fields.length && !wasExists) {
                    prop  = fields.slice(0,-1).join('.');
                    key   = _.last(fields);

                    this.__emitEvent('property.' + prop + '.item_added', key, newValue);
                    this.__emitEvent('property.item_added', prop, key, newValue);
                }
            }

            return this;
        }
function ( fields , newValue , oldValue , wasExists ) { fields = this . __resolveFields ( fields ) ; var prop , event , key , i , ii ; this . __checkEmitEvent ( true ) ; var isEqual = true ; if ( _ . isSimpleObject ( newValue ) && _ . isSimpleObject ( oldValue ) ) { for ( key in oldValue ) { if ( newValue [ key ] !== oldValue [ key ] ) { isEqual = false ; break ; } } } else if ( _ . isArray ( newValue ) && _ . isArray ( oldValue ) ) { for ( i = 0 , ii = oldValue . length ; i < ii ; ++ i ) { if ( newValue [ i ] !== oldValue [ i ] ) { isEqual = false ; break ; } } } else if ( newValue !== oldValue ) { isEqual = false ; } if ( ! isEqual ) { prop = fields . join ( '.' ) ; this . __emitEvent ( 'property.' + prop + '.' + 'set' , newValue , oldValue ) ; this . __emitEvent ( 'property.set' , prop , newValue , oldValue ) ; if ( fields . length && ! wasExists ) { prop = fields . slice ( 0 , - 1 ) . join ( '.' ) ; key = _ . last ( fields ) ; this . __emitEvent ( 'property.' + prop + '.item_added' , key , newValue ) ; this . __emitEvent ( 'property.item_added' , prop , key , newValue ) ; } } return this ; }
Emits property set events

@param {string|array} fields    Property fields
@param {*}            newValue  New property value
@param {*}            oldValue  Old property value
@param {boolean}      wasExists true if property was exist before setting
@returns {clazz|object} this

@this {clazz|object}
Emits property set events