Skip to content

Commit

Permalink
src: clean up usage of __proto__
Browse files Browse the repository at this point in the history
Prefer using Object.setPrototypeOf() instead.

PR-URL: #5069
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
JacksonTian authored and Myles Borins committed Feb 18, 2016
1 parent abfb2f5 commit 7958664
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
function startup() {
var EventEmitter = NativeModule.require('events');

process.__proto__ = Object.create(EventEmitter.prototype, {
Object.setPrototypeOf(process, Object.create(EventEmitter.prototype, {
constructor: {
value: process.constructor
}
});
}));

EventEmitter.call(process);

process.EventEmitter = EventEmitter; // process.EventEmitter is deprecated
Expand Down

0 comments on commit 7958664

Please sign in to comment.