Skip to content

Commit

Permalink
events: non-enumerable 'Symbol(kCapture)'
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 committed Feb 14, 2020
1 parent 0875837 commit 3dabcbf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ ObjectDefineProperty(EventEmitter, 'errorMonitor', {

// The default for captureRejections is false
ObjectDefineProperty(EventEmitter.prototype, kCapture, {
get () {
return this._kCapture
},
set (value) {
ObjectDefineProperty(this, '_kCapture', {
value,
writable: true,
enumerable: false
})
}
});

ObjectDefineProperty(EventEmitter.prototype, '_kCapture', {
value: false,
writable: true,
enumerable: false
Expand Down

0 comments on commit 3dabcbf

Please sign in to comment.