From 6342fe50f0f429e46280952f5d964083215b0502 Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Sat, 21 May 2022 17:51:01 +0800 Subject: [PATCH] cluster: use `kEmptyObject` PR-URL: https://github.com/nodejs/node/pull/43159 Reviewed-By: Matteo Collina Reviewed-By: Antoine du Hamel --- lib/internal/cluster/worker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/cluster/worker.js b/lib/internal/cluster/worker.js index 53285413530..d5dfef43871 100644 --- a/lib/internal/cluster/worker.js +++ b/lib/internal/cluster/worker.js @@ -7,6 +7,8 @@ const { const EventEmitter = require('events'); +const { kEmptyObject } = require('internal/util'); + module.exports = Worker; // Common Worker implementation shared between the cluster primary and workers. @@ -17,7 +19,7 @@ function Worker(options) { ReflectApply(EventEmitter, this, []); if (options === null || typeof options !== 'object') - options = {}; + options = kEmptyObject; this.exitedAfterDisconnect = undefined;