From ddf746c816f11cd0a816db523ffa35b33baef152 Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Thu, 22 Feb 2018 16:07:06 -0500 Subject: [PATCH] events: preset `usingDomains` to false The line setting this was removed in a previous commit. This potentially breaks code in the wild using this property. Refs: https://github.com/nodejs/node/pull/17403#issuecomment-367814130 --- lib/events.js | 2 ++ test/parallel/test-event-emitter-subclass.js | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/events.js b/lib/events.js index aec30e7239d13d..1c697943371ace 100644 --- a/lib/events.js +++ b/lib/events.js @@ -31,6 +31,8 @@ module.exports = EventEmitter; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; +EventEmitter.usingDomains = false; + EventEmitter.prototype._events = undefined; EventEmitter.prototype._eventsCount = 0; EventEmitter.prototype._maxListeners = undefined; diff --git a/test/parallel/test-event-emitter-subclass.js b/test/parallel/test-event-emitter-subclass.js index 5189c3aa13422f..094565197bd740 100644 --- a/test/parallel/test-event-emitter-subclass.js +++ b/test/parallel/test-event-emitter-subclass.js @@ -36,6 +36,7 @@ function MyEE(cb) { const myee = new MyEE(common.mustCall()); +myee.hasOwnProperty('usingDomains'); util.inherits(ErrorEE, EventEmitter); function ErrorEE() {