Skip to content

Commit

Permalink
cluster: destruct primordials in lib/internal/cluster/worker.js
Browse files Browse the repository at this point in the history
Refs: nodejs/code-and-learn#97

PR-URL: #30246
Refs: nodejs/code-and-learn#97
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
peze authored and MylesBorins committed Nov 17, 2019
1 parent b76c13e commit 6bf0e40
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/internal/cluster/worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use strict';

const { Object } = primordials;
const {
Object: {
setPrototypeOf: ObjectSetPrototypeOf
}
} = primordials;

const EventEmitter = require('events');

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6bf0e40

Please sign in to comment.