diff options
Diffstat (limited to 'lib/events.js')
-rw-r--r-- | lib/events.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/events.js b/lib/events.js index ad5ded2d0e9..603f3083ed2 100644 --- a/lib/events.js +++ b/lib/events.js @@ -52,6 +52,9 @@ const { SymbolAsyncIterator, } = primordials; const kRejection = SymbolFor('nodejs.rejection'); + +const { kEmptyObject } = require('internal/util'); + const { inspect } = require('internal/util/inspect'); let spliceOne; @@ -945,7 +948,7 @@ function getEventListeners(emitterOrTarget, type) { * @param {{ signal: AbortSignal; }} [options] * @returns {Promise} */ -async function once(emitter, name, options = {}) { +async function once(emitter, name, options = kEmptyObject) { const signal = options?.signal; validateAbortSignal(signal, 'options.signal'); if (signal?.aborted) |