Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGang Chen <13298548+MoonBall@users.noreply.github.com>2022-01-19 14:26:38 +0300
committerGitHub <noreply@github.com>2022-01-19 14:26:38 +0300
commit22792c8632fd17b151aa374c555b66bfc7c2022b (patch)
treef32d13c7014050bcc422b1d7d6a3faabfd410e2b /lib
parent26398575dc5b5155e7d31e961aaf5f189d584e08 (diff)
domain: pass opts to `EventEmitter.init`
PR-URL: https://github.com/nodejs/node/pull/41414 Fixes: https://github.com/nodejs/node/issues/41391 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/domain.js4
-rw-r--r--lib/events.js2
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/domain.js b/lib/domain.js
index fcc8bb0a6db..fbce94bad5f 100644
--- a/lib/domain.js
+++ b/lib/domain.js
@@ -446,7 +446,7 @@ Domain.prototype.bind = function(cb) {
EventEmitter.usingDomains = true;
const eventInit = EventEmitter.init;
-EventEmitter.init = function() {
+EventEmitter.init = function(opts) {
ObjectDefineProperty(this, 'domain', {
configurable: true,
enumerable: false,
@@ -457,7 +457,7 @@ EventEmitter.init = function() {
this.domain = exports.active;
}
- return FunctionPrototypeCall(eventInit, this);
+ return FunctionPrototypeCall(eventInit, this, opts);
};
const eventEmit = EventEmitter.prototype.emit;
diff --git a/lib/events.js b/lib/events.js
index 48a080d3460..f722b17aeca 100644
--- a/lib/events.js
+++ b/lib/events.js
@@ -321,6 +321,8 @@ EventEmitter.setMaxListeners =
}
};
+// If you're updating this function definition, please also update any
+// re-definitions, such as the one in the Domain module (lib/domain.js).
EventEmitter.init = function(opts) {
if (this._events === undefined ||