summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJackson Tian <shyvo1987@gmail.com>2016-02-04 10:53:17 +0800
committerMyles Borins <mborins@us.ibm.com>2016-03-02 14:01:11 -0800
commita1e0710cb16aee43e6a8c230dd2c76f5c5fa2f0d (patch)
tree8704e98a7fbf46c22ae8e922623300b0253f3a1f /src
parent029b8e809b49806554993d4b5c399f118a599f7e (diff)
downloadnodejs-a1e0710cb16aee43e6a8c230dd2c76f5c5fa2f0d.tar.gz
nodejs-a1e0710cb16aee43e6a8c230dd2c76f5c5fa2f0d.tar.bz2
nodejs-a1e0710cb16aee43e6a8c230dd2c76f5c5fa2f0d.zip
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>
Diffstat (limited to 'src')
-rw-r--r--src/node.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/node.js b/src/node.js
index 41e8fb195..1e90cbde0 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