handler for property changes; routes changes to observing methods note: array valued properties are observed for array splices
546967
function(newValues, oldValues, paths) {
      var name, method, called = {};
      for (var i in oldValues) {
        // note: paths is of form [object, path, object, path]
        name = paths[2 * i + 1];
        method = this.observe[name];
        if (method) {
          var ov = oldValues[i], nv = newValues[i];
          // observes the value if it is an array
          this.observeArrayValue(name, nv, ov);
          if (!called[method]) {
            // only invoke change method if one of ov or nv is not (undefined | null)
            if ((ov !== undefined && ov !== null) || (nv !== undefined && nv !== null)) {
              called[method] = true;
              // TODO(sorvell): call method with the set of values it's expecting;
              // e.g. 'foo bar': 'invalidate' expects the new and old values for
              // foo and bar. Currently we give only one of these and then
              // deliver all the arguments.
              this.invokeMethod(method, [ov, nv, arguments]);
            }
          }
        }
      }
    }
592965
function() {
      var self = this;

      var previousAttributes = _.clone(this.attributes);

      this.attributes = _.clone(this._serverData);
      Parse._arrayEach(this._opSetQueue, function(opSet) {
        self._applyOpSet(opSet, self.attributes);
        Parse._objectEach(opSet, function(op, key) {
          self._resetCacheForKey(key);
        });
      });

      // Trigger change events for anything that changed because of the fetch.
      Parse._objectEach(previousAttributes, function(oldValue, key) {
        if (self.attributes[key] !== oldValue) {
          self.trigger('change:' + key, self, self.attributes[key], {});
        }
      });
      Parse._objectEach(this.attributes, function(newValue, key) {
        if (!_.has(previousAttributes, key)) {
          self.trigger('change:' + key, self, newValue, {});
        }
      });
    }
1079588
function(vars, listener) {
            if (!Array.isArray(vars)) {
                vars = [vars];
            }
            if (vars.length == 0) return null;
            var found = false;
            vars.forEach(
                function(name) {
                    var data = this.findDataBinding(name);
                    var i, target;
                    for (i = 0 ; i < data[1].length ; i++) {
                        target = data[1][i];
                        if (listener === target) {
                            data[1].splice(i, 1);
                            found = true;
                            return;
                        }
                    }
                }, this
            );
            return found;
        }
764516
public void actionChangeNav() throws JspException {

        // save initialized instance of this class in request attribute for included sub-elements
        getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, this);

        // get request parameters
        String filename = getParamResource();
        // do not use #getParamNavText since it is decoded, see CmsWorkplace#fillParamValues(HttpServletRequest)
        String newText = getJsp().getRequest().getParameter(PARAM_NAVTEXT);
        String selectedPosString = getParamNavpos();

        try {
            // lock resource if autolock is enabled
            checkLock(getParamResource());
            // save the new NavText if not null
            if (newText != null) {
                CmsProperty newNavText = new CmsProperty();
                newNavText.setName(CmsPropertyDefinition.PROPERTY_NAVTEXT);
                CmsProperty oldNavText = getCms().readPropertyObject(
                    filename,
                    CmsPropertyDefinition.PROPERTY_NAVTEXT,
                    false);
                if (oldNavText.isNullProperty()) {
                    // property value was not already set
                    if (OpenCms.getWorkplaceManager().isDefaultPropertiesOnStructure()) {
                        newNavText.setStructureValue(newText);
                    } else {
                        newNavText.setResourceValue(newText);
                    }
                } else {
                    if (oldNavText.getStructureValue() != null) {
                        newNavText.setStructureValue(newText);
                        newNavText.setResourceValue(oldNavText.getResourceValue());
                    } else {
                        newNavText.setResourceValue(newText);
                    }
                }

                String oldStructureValue = oldNavText.getStructureValue();
                String newStructureValue = newNavText.getStructureValue();
                if (CmsStringUtil.isEmpty(oldStructureValue)) {
                    oldStructureValue = CmsProperty.DELETE_VALUE;
                }
                if (CmsStringUtil.isEmpty(newStructureValue)) {
                    newStructureValue = CmsProperty.DELETE_VALUE;
                }

                String oldResourceValue = oldNavText.getResourceValue();
                String newResourceValue = newNavText.getResourceValue();
                if (CmsStringUtil.isEmpty(oldResourceValue)) {
                    oldResourceValue = CmsProperty.DELETE_VALUE;
                }
                if (CmsStringUtil.isEmpty(newResourceValue)) {
                    newResourceValue = CmsProperty.DELETE_VALUE;
                }

                // change nav text only if it has been changed
                if (!oldResourceValue.equals(newResourceValue) || !oldStructureValue.equals(newStructureValue)) {
                    getCms().writePropertyObject(getParamResource(), newNavText);
                }
            }

            // determine the selected position
            float selectedPos = -1;
            try {
                selectedPos = Float.parseFloat(selectedPosString);
            } catch (Exception e) {
                // can usually be ignored
                if (LOG.isInfoEnabled()) {
                    LOG.info(e.getLocalizedMessage());
                }
            }

            // only update the position if a change is requested
            if (selectedPos != -1) {
                CmsProperty newNavPos = new CmsProperty();
                newNavPos.setName(CmsPropertyDefinition.PROPERTY_NAVPOS);
                CmsProperty oldNavPos = getCms().readPropertyObject(
                    filename,
                    CmsPropertyDefinition.PROPERTY_NAVPOS,
                    false);
                if (oldNavPos.isNullProperty()) {
                    // property value was not already set
                    if (OpenCms.getWorkplaceManager().isDefaultPropertiesOnStructure()) {
                        newNavPos.setStructureValue(selectedPosString);
                    } else {
                        newNavPos.setResourceValue(selectedPosString);
                    }
                } else {
                    if (oldNavPos.getStructureValue() != null) {
                        newNavPos.setStructureValue(selectedPosString);
                        newNavPos.setResourceValue(oldNavPos.getResourceValue());
                    } else {
                        newNavPos.setResourceValue(selectedPosString);
                    }
                }
                getCms().writePropertyObject(filename, newNavPos);
            }
        } catch (Throwable e) {
            // error during chnav, show error dialog
            includeErrorpage(this, e);
        }
        // chnav operation was successful, return to workplace
        actionCloseDialog();
    }
561707
function componentUpdate(tag, data, expressions) {
      var __ = tag.__;
      var nextOpts = {};
      var canTrigger = tag.isMounted && !__.skipAnonymous;

      // inherit properties from the parent tag
      if (__.isAnonymous && __.parent) { extend(tag, __.parent); }
      extend(tag, data);

      updateOpts.apply(tag, [__.isLoop, __.parent, __.isAnonymous, nextOpts, __.instAttrs]);

      if (
        canTrigger &&
        tag.isMounted &&
        isFunction$1(tag.shouldUpdate) && !tag.shouldUpdate(data, nextOpts)
      ) {
        return tag
      }

      extend(tag.opts, nextOpts);

      if (canTrigger) { tag.trigger('update', data); }
      update.call(tag, expressions);
      if (canTrigger) { tag.trigger('updated'); }

      return tag
    }
159643
function observableChanged(change) {
  const store = this;
  action(() => {
    store.dataChanges.set(change.name, change.newValue);

    if (store.isSame(store.dataChanges.get(change.name), store.dataServer[change.name])) {
      store.dataChanges.delete(change.name);
    }
  })();
}
1217077
def on_property_change(self, name, old_value, new_value):
        # pylint: disable=W0613
        
        if name in self._keys:
            try:
                if self.update_filter():
                    # This is a key for the filter and the filter has changed
                    # => Force the handler to update its dependency
                    self._reset()
            except ValueError:
                # Invalid filter: clear all references, this will invalidate
                # the component
                for svc_ref in self.get_bindings():
                    self.on_service_departure(svc_ref)
13646
function (observer, property) {
        if (!property)
            property = ALL;
        var arr = this.props[property];
        if (!arr) {
            // property is not observed yet
            arr = [];
            this.props[property] = arr;
        }
        arr.push(observer);
    }
539967
function stopWatchingForValueChange() {
  if (!activeElement) {
    return;
  }

  // delete restores the original property definition
  delete activeElement.value;
  activeElement.detachEvent('onpropertychange', handlePropertyChange);

  activeElement = null;
  activeElementID = null;
  activeElementValue = null;
  activeElementValueProp = null;
}
1315088
function observe($scope, $attrs, key, defValue, callbackFunc) {
        if (callbackFunc === void 0) { callbackFunc = null; }
        $attrs.$observe(key, function (value) {
            if (!angular.isDefined(value)) {
                $scope[key] = defValue;
            }
            else {
                $scope[key] = value;
            }
            if (angular.isDefined(callbackFunc) && callbackFunc) {
                callbackFunc($scope[key]);
            }
        });
    }
859328
function () {
            /*  determine parameters  */
            var params = $cs.params("observe", arguments, {
                name:        { pos: 0, req: true,   valid: "string"        },
                func:        { pos: 1, req: true,   valid: "function"      },
                touch:       {         def: false,  valid: "boolean"       },
                boot:        {         def: false,  valid: "boolean"       },
                op:          {         def: "set",  valid: /^(?:get|set|changed|splice|delete)$/ },
                spool:       {         def: null,   valid: "(null|string)" },
                noevent:     {         def: false,  valid: "boolean"       }
            });

            /*  parse the value name into selection path segments  */
            var path = _cs.select_parse(params.name);

            /*  determine the actual component owning the model
                as we want to subscribe the change event there only  */
            var owner = null;
            var model = null;
            var comp  = this;
            while (comp !== null) {
                owner = comp.property({ name: "ComponentJS:model", returnowner: true });
                if (!_cs.isdefined(owner))
                    throw _cs.exception("observe", "no model found containing value \"" + path[0] + "\"");
                model = owner.property("ComponentJS:model");
                if (_cs.isdefined(model.spec[path[0]]))
                    break;
                comp = owner.parent();
            }
            if (comp === null)
                throw _cs.exception("observe", "no model found containing value \"" + path[0] + "\"");

            /*  support wildcard matching and always match childs  */
            var name = path.join(".")
                .replace(/\./g, "\\.")
                .replace(/\*\*/g, ".+?")
                .replace(/\*/g, "[^.]+");
            name += "(?:\\.[^.]+)*";

            /*  subscribe to model value change event  */
            var id = owner.subscribe({
                name:      new RegExp("ComponentJS:model:" + name + ":" + params.op),
                capturing: false,
                spreading: false,
                bubbling:  false,
                noevent:   params.noevent,
                func:      params.func
            });

            /*  mark component for having subscribers of operation
                (for performance optimization reasons)  */
            var key = "ComponentJS:model:subscribers:" + params.op;
            var subscribers = owner.property({ name: key, def: 0 });
            subscribers += 1;
            owner.property({ name: key, value: subscribers });

            /*  optionally spool reverse operation  */
            if (params.spool !== null) {
                var info = _cs.spool_spec_parse(this, params.spool);
                info.comp.spool(info.name, this, "unobserve", id);
            }

            /*  if requested (for a one-time initial observer run),
                either touch the model value once (which causes _all_ observers to trigger!)
                or do a "bootstrapping execution" of only our callback function once  */
            if (params.touch)
                this.touch(params.name);
            else if (params.boot) {
                var value = this.value(params.name);
                var args = [ value, value, params.op, path.join(".") ];
                if (!params.noevent) {
                    args.unshift($cs.event({
                        name:        params.name,
                        spec:        {},
                        async:       false,
                        result:      undefined,
                        target:      this,
                        propagation: true,
                        processing:  true,
                        dispatched:  false
                    }));
                }
                params.func.apply(this, args);
            }

            return id;
        }
234689
function() {
      var updateEventsIsArray = _.isArray(this.updateEvents);
      var updateEventsIsSingleValue = !updateEventsIsArray && (_.isObject(this.updateEvents) || _.isString(this.updateEvents));
      var updateEventsIsUndefined = _.isUndefined(this.updateEvents);
      var updateEventsIsValidType = updateEventsIsArray || updateEventsIsSingleValue || updateEventsIsUndefined;

      if (updateEventsIsSingleValue) {
        this.updateEvents = [this.updateEvents];
      }

      if (!updateEventsIsValidType) {
        throw new Error('Update events are not an array, string or object.  Please see parameters for examples of how to define updateEvents.  Configured UpdateEvents: ', this.updateEvents);
      }

      // Remove any random falsey values (mostly to get rid of undefined events).
      this.updateEvents = _.compact(this.updateEvents);
      _.each(this.updateEvents, this.__validUpdateEvent);
    }
1288453
function (propertyName, newValue, oldValue) {
            if (propertyName === 'value') {
                this._checkValue();// checks the value changed in the data model is a valid value from the select
                // options
                if (this.controller) {
                    var report = this.controller.checkValue(newValue);
                    this._reactToControllerReport(report, {
                        stopValueProp : true
                    });
                } else {
                    this._selectValue(newValue);
                }
            } else if (propertyName === 'mandatory') {
                this._updateState();
            } else if (propertyName === 'readOnly' || propertyName === 'disabled') {
                var selectField = this.getSelectField();
                var disabledOrReadonly = this.getProperty("disabled") || this.getProperty("readOnly");
                if (this._skinObj.simpleHTML) {
                    selectField.disabled = disabledOrReadonly ? "disabled" : "";
                }
                var tabIndex = disabledOrReadonly ? -1 : this._calculateTabIndex();
                selectField.tabIndex = tabIndex;
                this._updateState();
            } else if (propertyName === 'options') {
                if (this.controller) {
                    var selectValue = this.controller.getDataModel().value;
                    this.controller.setListOptions(newValue);
                    var report = this.controller.checkValue(selectValue);
                    this._reactToControllerReport(report, {
                        stopValueProp : false
                    });
                } else {
                    // markup for the options
                    var optionsMarkup = [];
                    var stringUtils = ariaUtilsString;
                    for (var i = 0, l = newValue.length; i < l; i++) {
                        // string cast, otherwise encoding will fail
                        var optValue = '' + newValue[i].value;
                        optionsMarkup.push('<option value="', stringUtils.encodeForQuotedHTMLAttribute(optValue), '">', stringUtils.escapeHTML(newValue[i].label), '</option>');
                    }

                    var selectField = this.getSelectField();
                    var currentValue = selectField.value;
                    // update the options list
                    var optionsListString = optionsMarkup.join('');
                    if (ariaCoreBrowser.isIE9 || ariaCoreBrowser.isIE8 || ariaCoreBrowser.isIE7) {
                        // innerHTML replacing in IE truncates the first element and breaks the whole select...
                        selectField.innerHTML = '';
                        var helperDiv = Aria.$window.document.createElement('div');
                        helperDiv.innerHTML = '<select>' + optionsListString + '</select>';
                        var options = helperDiv.children[0].children;
                        while (options.length) {
                            selectField.appendChild(options[0]);
                        }
                    } else {
                        selectField.innerHTML = optionsListString;
                    }
                    this._selectValue(currentValue);
                }

            } else if (propertyName === 'formatError' || propertyName === 'formatErrorMessages'
                    || propertyName === 'error' || propertyName === 'errorMessages') {
                this._cfg[propertyName] = newValue;
                this._updateState();
            } else {
                this.$DropDownInput._onBoundPropertyChange.apply(this, arguments);
            }
        }
1211504
@Override
    public void valueForPathChanged(TreePath path, Object newValue){
        Object[] listeners = listenerList.getListenerList();
        TreeModelEvent e = null;
        for(int i = listeners.length-2; i>=0; i-=2){
            if(e==null)
                e = new TreeModelEvent(this, path.getPath(), null, null);
                ((TreeModelListener)listeners[i+1]).treeNodesChanged(e);
        }
    }
259143
function(type, handler) {
            var handlers = this._handlers[type],
                i,
                len;

            if (handlers instanceof Array) {
                if (!handler) {
                    handlers.length = 0;
                    return;
                }
                for (i = 0, len = handlers.length; i < len; i++) {
                    if (handlers[i] === handler || handlers[i].handler === handler) {
                        handlers.splice(i, 1);
                        break;
                    }
                }
            }
        }
373699
function handleProperties(schema, properties, node, stack) {
    var name = handleTagName(schema, node.tagName, node, stack)
    var attrs = schema.attributes
    var props = properties || {}
    var result = {}
    var allowed
    var prop
    var value

    allowed = own.call(attrs, name) ? attrs[name] : []
    allowed = [].concat(allowed, attrs['*'])

    for (prop in props) {
        value = props[prop]

        if (
            allowed.indexOf(prop) === -1 &&
            !(data(prop) && allowed.indexOf('data*') !== -1)
        ) {
            continue
        }

        if (value && typeof value === 'object' && 'length' in value) {
            value = handlePropertyValues(schema, value, prop)
        } else {
            value = handlePropertyValue(schema, value, prop)
        }

        if (value !== null && value !== undefined) {
            result[prop] = value
        }
    }

    return result
}
568766
function(eventName, handler) {
    if (!this.__eventListeners) {
      this.__eventListeners = { };
    }
    // one object with key/value pairs was passed
    if (arguments.length === 1) {
      for (var prop in eventName) {
        this.on(prop, eventName[prop]);
      }
    }
    else {
      if (!this.__eventListeners[eventName]) {
        this.__eventListeners[eventName] = [ ];
      }
      this.__eventListeners[eventName].push(handler);
    }
  }