From 30ef31431129ee199f0ed2af16e9d494a2e8e17e 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 2856943e4a9e78..cdb147d4f92959 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); let eeWarned = false;