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>
pull/5069/merge
Jackson Tian 2016-02-04 10:53:17 +08:00 committed by James M Snell
parent 07424705a6
commit 9aebb002b0
1 changed files with 3 additions and 2 deletions

View File

@ -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);
let eeWarned = false;