Skip to content

Commit acd7758

Browse files
deokjinkimmarco-ippolito
authored andcommitted
lib: use predefined variable instead of bit operation
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>
1 parent a4847c4 commit acd7758

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/internal/abort_controller.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ const {
4646
validateAbortSignalArray,
4747
validateObject,
4848
validateUint32,
49-
kValidateObjectAllowArray,
50-
kValidateObjectAllowFunction,
49+
kValidateObjectAllowObjects,
5150
} = require('internal/validators');
5251

5352
const {
@@ -434,7 +433,7 @@ async function aborted(signal, resource) {
434433
throw new ERR_INVALID_ARG_TYPE('signal', 'AbortSignal', signal);
435434
}
436435
validateAbortSignal(signal, 'signal');
437-
validateObject(resource, 'resource', kValidateObjectAllowArray | kValidateObjectAllowFunction);
436+
validateObject(resource, 'resource', kValidateObjectAllowObjects);
438437
if (signal.aborted)
439438
return PromiseResolve();
440439
const abortPromise = createDeferredPromise();

lib/internal/event_target.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ const {
4040
validateObject,
4141
validateString,
4242
validateInternalField,
43-
kValidateObjectAllowArray,
44-
kValidateObjectAllowFunction,
43+
kValidateObjectAllowObjects,
4544
} = require('internal/validators');
4645

4746
const {
@@ -1060,7 +1059,7 @@ function validateEventListenerOptions(options) {
10601059

10611060
if (options === null)
10621061
return kEmptyObject;
1063-
validateObject(options, 'options', kValidateObjectAllowArray | kValidateObjectAllowFunction);
1062+
validateObject(options, 'options', kValidateObjectAllowObjects);
10641063
return {
10651064
once: Boolean(options.once),
10661065
capture: Boolean(options.capture),

0 commit comments

Comments
 (0)