Wrap all modifying array methods, so change-emisions can be triggered
@name    monitorArray
@access  internal
@param   Array     a
@param   function  emitter
@return  Array     a
760775
function monitorArray(a, emit) {
		['copyWithin', 'fill', 'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift']
			.forEach(function(key) {
				var original = a[key];

				a[key] = function() {
					var result = original.apply(a, arguments);

					emit();

					return result;
				};
			});

		return a;
	}
1065204
function wrapMethod(target, method) {
        return function() {

            // Put arguments into a real array.
            var methodArgs = [];
            for (var i = 0; i < arguments.length; i++) {
                methodArgs.push(arguments[i]);
            }

            var params = method(target, parseMethodArgs, methodArgs);

            modifyTarget(target,
                params.source,
                params.sourceKeys,
                params.filters,
                params.overrideKeys);
            return this;
        };
    }
92129
function makeFunctionWrapper(original, functionName) {
  //log("wrap fn: " + functionName);
  var f = original[functionName];
  return function() {
    //log("call: " + functionName);
    var result = f.apply(original, arguments);
    return result;
  };
}
1012215
function _Emitter() {
		var eventTarget = document.createDocumentFragment();
		["addEventListener", "dispatchEvent", "removeEventListener"].forEach(function(method) {
			if (!this[method]) this[method] = eventTarget[method].bind(eventTarget);
		}, this);
	}
221588
function createArrayOfChecker(arrayItemChecker) {

    return createChainableChecker(function (data, dataName, componentName, fullDataName) {

        if (typeof arrayItemChecker !== 'function') {
            throw new Error('[SAN ERROR] '
                + 'Data `' + dataName + '` of `' + componentName + '` has invalid '
                + 'DataType notation inside `arrayOf`, expected `function`'
            );
        }

        var dataValue = data[dataName];
        var dataType = getDataType(dataValue);

        if (dataType !== 'array') {
            throw new Error('[SAN ERROR] '
                + 'Invalid ' + componentName + ' data `' + fullDataName + '` of type'
                + '(' + dataType + ' supplied to ' + componentName + ', '
                + 'expected array)'
            );
        }

        for (var i = 0, len = dataValue.length; i < len; i++) {
            arrayItemChecker(dataValue, i, componentName, fullDataName + '[' + i + ']');
        }

    });

}
939760
function removeListener(attr,func,child,update)
        {
          if(typeof func !== 'function') return bind;

          var isInput = (['value','checked'].indexOf(attr) !== -1),
              isStyle = (_allStyles.indexOf(attr) !== -1),
              listeners,
              x;

              function cut(attr,list)
              {
                var listenerFuncs = list[attr],
                    len = listenerFuncs.length;
                for(x=0;x<len;x++)
                {
                  if(listenerFuncs[x].toString() === func.toString())
                  {
                    listenerFuncs.splice(x,1);
                  }
                }
              }

          if(this.toString() !== bind.toString())
          {
            if(child)
            {
              var children = this.querySelectorAll('*'),
                  len = children.length;
              if(isStyle)
              {
                listeners = (update ? '_childStyleUpdateListeners' : '_childStyleListeners');
                cut(attr,this.attrListeners()[listeners]);
                listeners = (update ? '_parentStyleUpdateListeners' : '_parentStyleListeners');
              }
              else
              {
                if(attr === _all)
                {
                  listeners = (update ? '_childStyleUpdateListeners' : '_childStyleListeners');
                  cut(attr,this.attrListeners()[listeners]);
                }
                listeners = (update ? '_childAttrUpdateListeners' : '_childAttrListeners');
                cut(attr,this.attrListeners()[listeners]);
                listeners = (update ? '_parentAttrUpdateListeners' : '_parentAttrListeners');
              }
              for(x=0;x<len;x++)
              {
                var parents = children[x].attrListeners()[listeners][attr],
                    parentLen = parents.length;
                for(var i=0;i<parentLen;i++)
                {
                  if(parents[i].isEqualNode(this))
                  {
                    parents.slice(i,1);
                  }
                }
                if(attr === _all)
                {
                  listenersStyle = (update ? '_parentStyleUpdateListeners' : '_parentStyleListeners');
                  var parents = children[x].attrListeners()[listeners][attr],
                      parentLen = parents.length;
                  for(var i=0;i<parentLen;i++)
                  {
                    if(parents[i].isEqualNode(this))
                    {
                      parents.slice(i,1);
                    }
                  }
                }
              }
            }
            else
            {
              if(isStyle)
              {
                listeners = (update ? '_styleUpdateListeners' : '_styleListeners');
                cut(attr,this.attrListeners()[listeners]);
              }
              else
              {
                if(attr === _all)
                {
                  listeners = (update ? '_styleUpdateListeners' : '_styleListeners');
                  cut(attr,this.attrListeners()[listeners]);
                }
                listeners = (update ? '_attrUpdateListeners' : '_attrListeners');
                cut(attr,this.attrListeners()[listeners]);
              }
            }
          }
          else
          {
            if(isStyle)
            {
              listeners = (update ? _styleUpdateListeners : _styleListeners);
              cut(attr,listeners);
            }
            else
            {
              if(attr === _all)
              {
                listeners = (update ? _styleUpdateListeners : _styleListeners);
                cut(attr,listeners);
              }
              listeners = (update ? _attrUpdateListeners : _attrListeners);
              cut(attr,listeners);
            }
          }
        }
1357395
@Override
    public CheckedFunction1<Object[], Object> decorate(CheckedFunction1<Object[], Object> invocationCall,
            Method method,
            MethodHandler methodHandler,
            Target<?> target) {
        final Method fallbackMethod;
        validateFallback(method);
        fallbackMethod = getFallbackMethod(method);
        return args -> {
            try {
                return invocationCall.apply(args);
            } catch (final Exception exception) {
                if (filter.test(exception)) {
                    return fallbackMethod.invoke(fallback, args);
                }
                throw exception;
            }
        };
    }
981728
public static <T> Function<Void, T> wrap(final Function<T, T> function,
        final Function<Function<T, T>, T> wrapper) {
        return new Function<Void, T>() {
            public T apply(final Void arg) {
                return wrapper.apply(function);
            }
        };
    }
1088591
private static void collectFunctions_r(DebuggableScript function,
                                             ObjArray array) {
        array.add(function);
        for (int i = 0; i != function.getFunctionCount(); ++i) {
            collectFunctions_r(function.getFunction(i), array);
        }
    }
1078053
def function(self, new_function):
        """"""
        self._client.change_state(
            self._monitor_url,
            {'Monitor[Function]': new_function.value})
963531
function _A(a) {
        return Array.prototype.slice.apply(a, Array.prototype.slice.call(arguments, 1));
    }
262734
function(array, fn) {
        if (typeof array.map == "function") {
          return array.map(fn);
        } else {
          var r = [];
          var l = array.length;
          for(var i = 0; i < l; i++) {
            r.push(fn(array[i]));
          }
          return r;
        }
      }
326973
function ( target, callback ) {
            if ( typeof Array.prototype.forEach === 'function' ) {
                this.forEach = function ( target, callback ) {
                    if ( this.is(target) ) {
                        target.forEach( callback );
                    } else {
                        throw new Error('[ixBand] "forEach()" ' + MSG_NOT_ARRAY);
                    }
                };
            } else {
                this.forEach = function ( target, callback ) {
                    if ( this.is(target) ) {
                        var tArray = target,
                            aryNum = tArray.length, i;
    
                        for ( i = 0; i < aryNum; ++i ) {
                            callback.call( this , tArray[i], i, tArray );
                        }
                    } else {
                        throw new Error('[ixBand] "forEach()" ' + MSG_NOT_ARRAY);
                    }
                };
            }
    
            this.forEach( target, callback );
        }
78399
function wrapMutatingArrayMethod(method, func) {
      return function() {
        var result = [][method].apply(obj, arguments);
        this.len = this.values.length;
        cache = {};
        children = {};
        func.apply(this, arguments);
        target.parent.trigger('update', target.prop);
        return result;
      };
    }
436965
function (args, callback) {
    var sources = Array.prototype.slice.call(args);
    var target = sources.shift();

    sources.forEach(function(source) {
        callback(target, source);
    });

    return target;
}
718824
function VarianceFunction(win) {
  var self = this, m, m2, d, n;
  self.name = "vars";
  self.type = "simple";
  self.init = function() { m = 0; m2 = 0; d = 0; n = 0; };
  self.accumulate = function(v) { n+=1; d = v - m; m = d/n + m; m2 = m2 + d*(v - m); };
  self.compensate = function(v) { n-=1; d = m - v; m = m + d/n; m2 = d*(v - m) + m2; };
  self.emit = function()  { return m2/(n-1); };
  self.make = function(win) { return new VarianceFunction(win); };
}
918863
function createEventEmitterCallback(event, emitter) {
    return function (ex) {
        if (ex) {
            emitter.emit('error', ex);
        } else {
            var args = Array.prototype.slice.call(arguments);
            args[0] = event;
            emitter.emit.apply(emitter, args);
            if (event == 'end') {
                emitter.removeAllListeners();
            }
        }
    };
}