Skip to content
Permalink
Browse files

cluster: destruct primordials in lib/internal/cluster/worker.js

Refs: nodejs/code-and-learn#97

PR-URL: #30246
Refs: nodejs/code-and-learn#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>
  • Loading branch information
peze authored and MylesBorins committed Nov 4, 2019
1 parent ddbe982 commit 2938fe31aee3a618e67fde1e022f8f7d8425c5d7
Showing with 7 additions and 3 deletions.
  1. +7 −3 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);

0 comments on commit 2938fe3

Please sign in to comment.
You can’t perform that action at this time.