summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBryan English <bryan@bryanenglish.com>2016-10-26 15:21:36 -0700
committerAnna Henningsen <anna@addaleax.net>2017-03-25 00:33:20 +0100
commite0bc5a7361b1d29c3ed034155fd779ce6f44fb13 (patch)
tree4adc41ee23c2b750639264a1bb7f958da27ad56f /lib
parent2141d374527337f7e1c74c9efad217b017d945cf (diff)
downloadandroid-node-v8-e0bc5a7361b1d29c3ed034155fd779ce6f44fb13.tar.gz
android-node-v8-e0bc5a7361b1d29c3ed034155fd779ce6f44fb13.tar.bz2
android-node-v8-e0bc5a7361b1d29c3ed034155fd779ce6f44fb13.zip
process: maintain constructor descriptor
Use the original property descriptor instead of just taking the value, which would, by default, be non-writable and non-configurable. PR-URL: https://github.com/nodejs/node/pull/9306 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/bootstrap_node.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
index 51b7f928cb..ab3665f03d 100644
--- a/lib/internal/bootstrap_node.js
+++ b/lib/internal/bootstrap_node.js
@@ -13,10 +13,9 @@
const EventEmitter = NativeModule.require('events');
process._eventsCount = 0;
+ const origProcProto = Object.getPrototypeOf(process);
Object.setPrototypeOf(process, Object.create(EventEmitter.prototype, {
- constructor: {
- value: process.constructor
- }
+ constructor: Object.getOwnPropertyDescriptor(origProcProto, 'constructor')
}));
EventEmitter.call(process);