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 <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
JacksonTian authored and rvagg committed Feb 9, 2016
1 parent 4c54c8f commit 9561519
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 9561519

Please sign in to comment.