diff --git a/lib/events.js b/lib/events.js index fe7c048738f..7e219a14a4a 100644 --- a/lib/events.js +++ b/lib/events.js @@ -20,11 +20,12 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. var isArray = Array.isArray; +var domain; function EventEmitter() { if (exports.usingDomains) { // if there is an active domain, then attach to it. - var domain = require('domain'); + domain = domain || require('domain'); if (domain.active && !(this instanceof domain.Domain)) { this.domain = domain.active; }