Skip to content

Commit

Permalink
lib: use predefined variable instead of bit operation
Browse files Browse the repository at this point in the history
PR-URL: #52580
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
deokjinkim authored and aduh95 committed Apr 29, 2024
1 parent 910533f commit 9ffdcad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions lib/internal/abort_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ const {
validateAbortSignalArray,
validateObject,
validateUint32,
kValidateObjectAllowArray,
kValidateObjectAllowFunction,
kValidateObjectAllowObjects,
} = require('internal/validators');

const {
Expand Down Expand Up @@ -439,7 +438,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();
Expand Down
5 changes: 2 additions & 3 deletions lib/internal/event_target.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ const {
validateObject,
validateString,
validateInternalField,
kValidateObjectAllowArray,
kValidateObjectAllowFunction,
kValidateObjectAllowObjects,
} = require('internal/validators');

const {
Expand Down Expand Up @@ -1056,7 +1055,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),
Expand Down

0 comments on commit 9ffdcad

Please sign in to comment.