From b331d0f7bdb99a57949fb16568f301c225925e1b 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 --- 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);