Skip to content

Instantly share code, notes, and snippets.

@jblebrun
Created April 11, 2017 16:28
Show Gist options
  • Select an option

  • Save jblebrun/651eaddbb84789a8718efc3604595591 to your computer and use it in GitHub Desktop.

Select an option

Save jblebrun/651eaddbb84789a8718efc3604595591 to your computer and use it in GitHub Desktop.
EventEmitter from 0.10.21
function EventEmitter() {
this.domain = null;
if (exports.usingDomains) {
// if there is an active domain, then attach to it.
domain = domain || require('domain');
if (domain.active && !(this instanceof domain.Domain)) {
this.domain = domain.active;
}
}
this._events = this._events || {};
this._maxListeners = this._maxListeners || defaultMaxListeners;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment