From 853d73bb5017deed4be84b0e17ba8372d25a319e 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 fb39c0e2e74810..19b383ab70b001 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