diff options
author | Benjamin Gruenbaum <benjamingr@gmail.com> | 2020-05-28 19:08:43 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2020-06-06 02:55:26 +0300 |
commit | bf33b61be04988d95bd2373e3b931e09d254e06b (patch) | |
tree | 4fabb56713b2c8b21ed0036fec454279c7975f03 /lib/internal/event_target.js | |
parent | 1969ada9824cb01c2ba46470faa5327a9c2ef263 (diff) |
events: support useCapture boolean
PR-URL: https://github.com/nodejs/node/pull/33618
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'lib/internal/event_target.js')
-rw-r--r-- | lib/internal/event_target.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index df25200f1b0..8641129b132 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -413,6 +413,9 @@ function validateListener(listener) { } function validateEventListenerOptions(options) { + if (typeof options === 'boolean') { + options = { capture: options }; + } if (options == null || typeof options !== 'object') throw new ERR_INVALID_ARG_TYPE('options', 'object', options); const { |