events: convert errorMonitor to a normal property

Convert property errorMonitor to a normal property as non-writable
caused unwanted side effects.

Refs: https://github.com/nodejs/node/pull/30932#discussion_r379679982

PR-URL: https://github.com/nodejs/node/pull/31848
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Gerhard Stoebich authored and Myles Borins committed 2020-03-04 16:30:29 -05:00
1 parent be90817558
commit 3c8daa3aa0
1 file changed
+1 -6
+1 -6
View File
@@ -90,12 +90,7 @@ ObjectDefineProperty(EventEmitter, 'captureRejections', {
enumerable: true
});
ObjectDefineProperty(EventEmitter, 'errorMonitor', {
value: kErrorMonitor,
writable: false,
configurable: true,
enumerable: true
});
EventEmitter.errorMonitor = kErrorMonitor;
// The default for captureRejections is false
ObjectDefineProperty(EventEmitter.prototype, kCapture, {