diff --git a/lib/internal/abort_controller.js b/lib/internal/abort_controller.js index ce3539fda3154d..6aa013b5894e89 100644 --- a/lib/internal/abort_controller.js +++ b/lib/internal/abort_controller.js @@ -46,8 +46,7 @@ const { validateAbortSignalArray, validateObject, validateUint32, - kValidateObjectAllowArray, - kValidateObjectAllowFunction, + kValidateObjectAllowObjects, } = require('internal/validators'); const { @@ -434,7 +433,7 @@ async function aborted(signal, resource) { throw new ERR_INVALID_ARG_TYPE('signal', 'AbortSignal', signal); } validateAbortSignal(signal, 'signal'); - validateObject(resource, 'resource', kValidateObjectAllowArray | kValidateObjectAllowFunction); + validateObject(resource, 'resource', kValidateObjectAllowObjects); if (signal.aborted) return PromiseResolve(); const abortPromise = createDeferredPromise(); diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index 9d9ad1f222b903..77cb7a12bbb483 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -40,8 +40,7 @@ const { validateObject, validateString, validateInternalField, - kValidateObjectAllowArray, - kValidateObjectAllowFunction, + kValidateObjectAllowObjects, } = require('internal/validators'); const { @@ -1060,7 +1059,7 @@ function validateEventListenerOptions(options) { if (options === null) return kEmptyObject; - validateObject(options, 'options', kValidateObjectAllowArray | kValidateObjectAllowFunction); + validateObject(options, 'options', kValidateObjectAllowObjects); return { once: Boolean(options.once), capture: Boolean(options.capture),