The EventReactor plugin that allows you to extend update the EventEmitter
prototype.

@constructor
@param {Object} options
@param {Prototype} proto prototype that needs to be extended
@api public
974498
function EventReactor(options, proto) {
    // allow initialization without a new prefix
    if (!(this instanceof EventReactor)) return new EventReactor(options, proto);

    options = options || {};
    this.restore = {};

    // don't attach the extra event reactor methods, we are going to apply them
    // manually to the prototypes
    if (options.manual) return this;

    var methods = EventReactor.generation
      , method;

    for (method in methods) {
      if (methods.hasOwnProperty(method)) {
        this[method](proto);
      }
    }

    // such as aliases and emit overrides
    this.aliases(proto);
    this.emit(proto);
  }
1011268
function proto() {
    var args = arguments // 

    if(args.length == 1) {
        var parent = {init: noop}
        var prototypeBuilder = args[0]

    } else { // length == 2
        var parent = args[0]
        var prototypeBuilder = args[1]
    }

    // special handling for Error objects
    var namePointer = {}    // name used only for Error Objects
    if([Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError].indexOf(parent) !== -1) {
        parent = normalizeErrorObject(parent, namePointer)
    }

    // set up the parent into the prototype chain if a parent is passed
    var parentIsFunction = typeof(parent) === "function"
    if(parentIsFunction) {
        prototypeBuilder[prototypeName] = parent[prototypeName]
    } else {
        prototypeBuilder[prototypeName] = parent
    }

    // the prototype that will be used to make instances
    var prototype = new prototypeBuilder(parent)
    namePointer.name = prototype.name

    // if there's no init, assume its inheriting a non-proto class, so default to applying the superclass's constructor.
    if(!prototype[init] && parentIsFunction) {
        prototype[init] = function() {
            parent.apply(this, arguments)
        }
    }

    // constructor for empty object which will be populated via the constructor
    var F = function() {}
        F[prototypeName] = prototype    // set the prototype for created instances

    var constructorName = prototype.name?prototype.name:''
    if(prototype[init] === undefined || prototype[init] === noop) {
        var ProtoObjectFactory = new Function('F',
            "return function " + constructorName + "(){" +
                "return new F()" +
            "}"
        )(F)
    } else {
        // dynamically creating this function cause there's no other way to dynamically name a function
        var ProtoObjectFactory = new Function('F','i','u','n', // shitty variables cause minifiers aren't gonna minify my function string here
            "return function " + constructorName + "(){ " +
                "var x=new F(),r=i.apply(x,arguments)\n" +    // populate object via the constructor
                "if(r===n)\n" +
                    "return x\n" +
                "else if(r===u)\n" +
                    "return n\n" +
                "else\n" +
                    "return r\n" +
            "}"
        )(F, prototype[init], proto[protoUndefined]) // note that n is undefined
    }

    prototype.constructor = ProtoObjectFactory;    // set the constructor property on the prototype

    // add all the prototype properties onto the static class as well (so you can access that class when you want to reference superclass properties)
    for(var n in prototype) {
        addProperty(ProtoObjectFactory, prototype, n)
    }

    // add properties from parent that don't exist in the static class object yet
    for(var n in parent) {
        if(ownProperty.call(parent, n) && ProtoObjectFactory[n] === undefined) {
            addProperty(ProtoObjectFactory, parent, n)
        }
    }

    ProtoObjectFactory.parent = parent;            // special parent property only available on the returned proto class
    ProtoObjectFactory[prototypeName] = prototype  // set the prototype on the object factory

    return ProtoObjectFactory;
}
343850
function(options)
	{
		options = conbo.defineDefaults(options, this.options);
		
		if (!!options.context) this.context = options.context;
		this.preinitialize(options);
		
		this._httpService = new conbo.HttpService(options);
		this._command = options.command;
		
		var resultHandler = function(event)
		{
			conbo.makeBindable(this, conbo.variables(event.result));
			conbo.assign(this, event.result);
			
			this.dispatchEvent(event);
		};
		
		this._httpService
			.addEventListener(conbo.ConboEvent.RESULT, resultHandler, this)
			.addEventListener(conbo.ConboEvent.FAULT, this.dispatchEvent, this);
		
		__denumerate(this);
		
		conbo.Hash.prototype.__construct.apply(this, arguments);
	}
677399
function dispatchEvent (event, data) {
    if (hasDOM()) {
      eventEmitter.dispatchEvent(new CustomEvent(event, data));
    } else if (hasEventEmitter()) {
      eventEmitter.emit(event, data);
    }
  }
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();
            }
        }
    };
}
1243283
function eventToPromise (emitter, event, opts) {
  var cancel
  var promise = new Promise(function (resolve, reject) {
    var addEvent = makeEventAdder(emitter, opts && opts.array)
    cancel = function () {
      cancel = noop
      addEvent.cleanUp()
    }

    addEvent(event, resolve)

    if (!opts || !opts.ignoreErrors) {
      addEvent((opts && opts.error) || 'error', reject)
    }
  })
  promise.cancel = function () { return cancel() }

  return promise
}
702752
function ArrayEmitter(...args) {

  // Need to generate an actual array here for proper behaviour (in a full ES6 environment we
  // should be able to subclass array. But alas)
  var arr = new Array(...args);

  // Non enumerable so that we can send the array over postMessage
  Object.defineProperty(arr, '$emitter', {
    enumerable: false,
    value: new EventEmitter()
  });

  // Generate our Array Emitter methods
  var ArrayEmitterMethods = {};
  ['on', 'once', 'addListener', 'removeListener'].forEach(function(key) {
    ArrayEmitterMethods[key] = {
      enumerable: false,
      value: function(...args) {
        return this.$emitter[key](...args);
      }
    };
  });

  // These methods create new arrays
  ['reverse', 'sort', 'splice'].forEach(function(key) {
    ArrayEmitterMethods[key] = {
      enumerable: false,
      value: function(...args) {
        var _emitter = this.$emitter;
        incrMaxListeners(_emitter);
        _emitter.on('update', () => {
          ArrayProto[key].apply(this, args);
        });

        ArrayProto[key].apply(this, args);
        return this;
      }
    };
  });

  ['filter', 'map', 'slice'].forEach(function(key) {
    ArrayEmitterMethods[key] = {
      enumerable: false,
      value: function(...args) {
        var newArr = new ArrayEmitter();
        var _emitter = this.$emitter;
        incrMaxListeners(_emitter);
        _emitter.on('update', () => {
          updateNewArr(ArrayProto[key].apply(this, args));
          newArr.$emitter.emit('update', newArr);
        });

        updateNewArr(ArrayProto[key].apply(this, args));

        function updateNewArr(arr) {
          newArr.length = 0;
          for (var i = 0; i < arr.length; i++) {
            newArr.push(arr[i]);
          }
        }

        return newArr;
      }
    };
  });

  ArrayEmitterMethods.concat = {
    enumerable: false,
    value: function(...args) {
      var newArr = new ArrayEmitter();
      var allArrs = [this, ...args];
      var qries = allArrs.filter((obj) => (Array.isArray(obj) && obj.$emitter));
      qries.forEach((_qry) => {
        var _emitter = _qry.$emitter;
        incrMaxListeners(_emitter);
        _emitter.on('update', () => {
          updateConcat();
          newArr.$emitter.emit('update', newArr);
        });
      });

      updateConcat();

      return newArr;

      function updateConcat() {
        var concatted = ArrayProto.concat.call(...allArrs);
        newArr.length = 0;
        newArr.push(...concatted);
      }
    }
  };

  Object.defineProperties(arr, ArrayEmitterMethods);

  return arr;
}
865473
function(options) {
	events.EventEmitter.call(this); 	// inherit from EventEmitter
    	TRACE 		= options.log;
	IDX 		= options.idx;
	STATUS 		= options.status;
	HOST 		= options.host;
	REQUEST		= options.request;
	this.domoMQTT	= this.connect(HOST);
}
484010
function(options) {
    
    // Call super class.
    EventEmitter.call(this);
    
    // Set options and load defaults if needed.
    this.options = options || {};
    
    this.host = this.options.host || 'localhost';
    this.port = this.options.port || 5672;
    this.protocol = this.options.protocol || 'amqp';
    this.login = this.options.login;
    this.password = this.options.password;
    this.vhost = this.options.vhost;
    this.task = this.options.task;

    this.url = this.protocol + '://';
    if (this.login && this.password) {
        this.url += this.login + ':' + this.password + '@';
    }
    this.url += this.host;
    if (this.port) {
        this.url += ':' + this.port;
    }
    if (this.vhost) {
        this.url += this.vhost;
    }

}
332171
function EventEmitter() {
  this._events = { };
  this._once   = { };
  // default to 10 max liseners
  this._maxListeners = 10;

  this._add = function (event, listener, once) {
    var entry = { listener: listener };
    if (once) {
      entry.once = true;
    }

    if (this._events[event]) {
      this._events[event].push(entry);
    } else {
      this._events[event] = [ entry ];
    }

    if (this._maxListeners && this._events[event].count > this._maxListeners && console && console.warn) {
      console.warn("EventEmitter Error: Maximum number of listeners");
    }

    return this;
  };

  this.on = function (event, listener) {
    return this._add(event, listener);
  };

  this.addListener = this.on;

  this.once = function (event, listener) {
    return this._add(event, listener, true);
  };

  this.removeListener = function (event, listener) {
    if (!this._events[event]) {
      return this;
    }

    for(var i = this._events.length-1; i--;) {
      if (this._events[i].listener === callback) {
        this._events.splice(i, 1);
      }
    }

    return this;
  };

  this.removeAllListeners = function (event) {
    this._events[event] = undefined;

    return this;
  };

  this.setMaxListeners = function (count) {
    this._maxListeners = count;

    return this;
  };

  this.emit = function () {
    var args = Array.prototype.slice.apply(arguments);
    var remove = [ ], i;

    if (args.length) {
      var event = args.shift();

      if (this._events[event]) {
        for (i = this._events[event].length; i--;) {
          this._events[event][i].listener.apply(null, args);
          if (this._events[event][i].once) {
            remove.push(listener);
          }
        }
      }

      for (i = remove.length; i--;) {
        this.removeListener(event, remove[i]);
      }
    }

    return this;
  };
}
553732
function(eventhandlerfactory) {

    var eventhandler = new function(){

    }

    var thehandler = function() {};
    thehandler.prototype.onStartDocument = function (funct){
      eventhandler.onStartDocument = funct;
    }
    thehandler.prototype.onEndDocument = function (funct){
      eventhandler.onEndDocument = funct;
    }
    thehandler.prototype.onStartElementNS = function (funct){
      eventhandler.onStartElementNS = funct;
    }
    thehandler.prototype.onEndElementNS = function (funct){
      eventhandler.onEndElementNS = funct;
    }
    thehandler.prototype.onCharacters = function(funct) {
      eventhandler.onCharacters = funct;
    }
    thehandler.prototype.onCdata = function(funct) {
      eventhandler.onCdata = funct;
    }
    thehandler.prototype.onComment = function(funct) {
      eventhandler.onComment = funct;
    }
    thehandler.prototype.onWarning = function(funct) {
      eventhandler.onWarning = funct;
    }

    thehandler.prototype.onError = function(funct) {
      eventhandler.onError = funct;
    }


    eventhandlerfactory(new thehandler());
    //eventhandler = eventhandler(eventhandler);
    this.m_hndDoc = eventhandler;
    this.m_hndErr = eventhandler;
    this.m_hndLex = eventhandler;
    this.m_interrupted = false;
}
133761
function(event) {
            var args = Array.prototype.slice.call(arguments);
            (this.emitter || (this.emitter = new emitter())).emit.apply(this, args);
        }
1314329
function(options){
    EventEmitter.call(this);

    // Data Structures
    // Persistence
    this.data = {};
    this.triggers = {};
    this.queue = [];
    this.nextTick = false;

    // Dynamic
    this.needs = {};
    this.events = {};
    this.options = options || {};
}
1217405
function Dispatcher(emitter, events) {
  if (!(this instanceof Dispatcher)) return new Dispatcher(emitter, events);

  assert(emitter instanceof EventEmitter, 'simple-dispatcher: emitter should be an EventEmitter');
  assert('object' == typeof events, 'simple-dispatcher: events should be an object');

  // iterate over keys in event
  // and map the cb values to the emitter.

  Object.keys(events).forEach(function(key) {
    var arr = Array.isArray(events[key]) ? events[key] : [events[key]];
    arr.forEach(function(cb) {
      emitter.on(key, cb);
    });
  });
}
867088
function( options ){
      this.options = options;

      registrant.call( this, options );

      // make sure layout has _private for use w/ std apis like .on()
      if( !is.plainObject( this._private ) ){
        this._private = {};
      }

      this._private.cy = options.cy;
      this._private.listeners = [];

      this.createEmitter();
    }
1079040
function eventPromise (emitter, eventName) {
  return new Promise((resolve, reject) => {
    emitter.on(eventName, (...args) => {
      return resolve(args)
    })
  })
}
1315477
function Glob(options) {
  if (!(this instanceof Glob)) {
    return new Glob(options);
  }

  Emitter.call(this);
  this.handler = new Handler(this);
  this.init(options);
}