Browse Source

src: clean up usage of __proto__

Prefer using Object.setPrototypeOf() instead.

PR-URL: https://github.com/nodejs/node/pull/5069
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v5.x
Jackson Tian 9 years ago
committed by Rod Vagg
parent
commit
95615196de
  1. 5
      src/node.js

5
src/node.js

@ -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

Loading…
Cancel
Save