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 <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 targos committed Dec 1, 2019
1 parent 0e105bd commit 5c72cc3
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 5c72cc3

Please sign in to comment.