From 7958664e855109c8d343196296a65ee091405840 Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Thu, 4 Feb 2016 10:53:17 +0800 Subject: [PATCH] src: clean up usage of __proto__ Prefer using Object.setPrototypeOf() instead. PR-URL: https://github.com/nodejs/node/pull/5069 Reviewed-By: Trevor Norris Reviewed-By: James M Snell --- src/node.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node.js b/src/node.js index 41e8fb1957d788..1e90cbde044063 100644 --- a/src/node.js +++ b/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