From 2938fe31aee3a618e67fde1e022f8f7d8425c5d7 Mon Sep 17 00:00:00 2001 From: peze Date: Mon, 4 Nov 2019 13:44:44 +0800 Subject: [PATCH] cluster: destruct primordials in lib/internal/cluster/worker.js Refs: nodejs/code-and-learn#97 PR-URL: https://github.com/nodejs/node/pull/30246 Refs: https://github.com/nodejs/code-and-learn/issues/97 Reviewed-By: Gireesh Punathil Reviewed-By: Khaidi Chu Reviewed-By: Yongsheng Zhang Reviewed-By: Anna Henningsen Reviewed-By: Jiawen Geng Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater --- lib/internal/cluster/worker.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/internal/cluster/worker.js b/lib/internal/cluster/worker.js index 9d9c5dce839035..4563b2e663b686 100644 --- a/lib/internal/cluster/worker.js +++ b/lib/internal/cluster/worker.js @@ -1,6 +1,10 @@ 'use strict'; -const { Object } = primordials; +const { + Object: { + setPrototypeOf: ObjectSetPrototypeOf + } +} = primordials; const EventEmitter = require('events'); @@ -32,8 +36,8 @@ function Worker(options) { } } -Object.setPrototypeOf(Worker.prototype, EventEmitter.prototype); -Object.setPrototypeOf(Worker, EventEmitter); +ObjectSetPrototypeOf(Worker.prototype, EventEmitter.prototype); +ObjectSetPrototypeOf(Worker, EventEmitter); Worker.prototype.kill = function() { this.destroy.apply(this, arguments);