From 6657b153abba09a16e4a628f3a46fc2cdf176b7d 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 PR-URL: https://github.com/nodejs/node/pull/18944 Reviewed-By: Vladimir de Turckheim Reviewed-By: Anna Henningsen Reviewed-By: Benjamin Gruenbaum --- 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() {