Skip to content

Commit f7a9cdc

Browse files
authored
lib: use predefined variable instead of bit operation
PR-URL: #52580 Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Daeyeon Jeong <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 9790ddf commit f7a9cdc

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/internal/abort_controller.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ const {
4545
validateAbortSignalArray,
4646
validateObject,
4747
validateUint32,
48-
kValidateObjectAllowArray,
49-
kValidateObjectAllowFunction,
48+
kValidateObjectAllowObjects,
5049
} = require('internal/validators');
5150

5251
const {
@@ -439,7 +438,7 @@ async function aborted(signal, resource) {
439438
throw new ERR_INVALID_ARG_TYPE('signal', 'AbortSignal', signal);
440439
}
441440
validateAbortSignal(signal, 'signal');
442-
validateObject(resource, 'resource', kValidateObjectAllowArray | kValidateObjectAllowFunction);
441+
validateObject(resource, 'resource', kValidateObjectAllowObjects);
443442
if (signal.aborted)
444443
return PromiseResolve();
445444
const abortPromise = createDeferredPromise();

lib/internal/event_target.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ const {
3636
validateObject,
3737
validateString,
3838
validateInternalField,
39-
kValidateObjectAllowArray,
40-
kValidateObjectAllowFunction,
39+
kValidateObjectAllowObjects,
4140
} = require('internal/validators');
4241

4342
const {
@@ -1056,7 +1055,7 @@ function validateEventListenerOptions(options) {
10561055

10571056
if (options === null)
10581057
return kEmptyObject;
1059-
validateObject(options, 'options', kValidateObjectAllowArray | kValidateObjectAllowFunction);
1058+
validateObject(options, 'options', kValidateObjectAllowObjects);
10601059
return {
10611060
once: Boolean(options.once),
10621061
capture: Boolean(options.capture),

0 commit comments

Comments
 (0)