mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
lib: use predefined variable instead of bit operation
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
910533fcfd
commit
9ffdcade37
2 files changed
+4
-6
No files matched your search
@@ -45,8 +45,7 @@ const {
|
||||
validateAbortSignalArray,
|
||||
validateObject,
|
||||
validateUint32,
|
||||
kValidateObjectAllowArray,
|
||||
kValidateObjectAllowFunction,
|
||||
kValidateObjectAllowObjects,
|
||||
} = require('internal/validators');
|
||||
|
||||
const {
|
||||
@@ -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();
|
||||
|
||||
@@ -36,8 +36,7 @@ const {
|
||||
validateObject,
|
||||
validateString,
|
||||
validateInternalField,
|
||||
kValidateObjectAllowArray,
|
||||
kValidateObjectAllowFunction,
|
||||
kValidateObjectAllowObjects,
|
||||
} = require('internal/validators');
|
||||
|
||||
const {
|
||||
@@ -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),
|
||||
|
||||
Reference in new issue
Block a user