Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
src: clean up usage of __proto__
Prefer using Object.setPrototypeOf() instead.
  • Loading branch information
JacksonTian committed Feb 4, 2016
commit 083eee237c8216b930326a56da0f74ddc8586693
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