diff options
author | peze <cpj1106@gmail.com> | 2019-11-04 08:44:44 +0300 |
---|---|---|
committer | ZYSzys <zyszys98@gmail.com> | 2019-11-09 09:43:13 +0300 |
commit | 0356746f50189368172d389ea1b69d8876cf329b (patch) | |
tree | ad38e4a2fa8532425402a3b1b0651f73f3b74e62 /lib/internal/cluster | |
parent | cb34358dd9ceb0b2a7ddcf14120000cb060d8181 (diff) |
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 <gpunathi@in.ibm.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'lib/internal/cluster')
-rw-r--r-- | lib/internal/cluster/worker.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/internal/cluster/worker.js b/lib/internal/cluster/worker.js index 9d9c5dce839..4563b2e663b 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); |