Skip to content

Commit 9ffdcad

Browse files
deokjinkimaduh95
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 910533f commit 9ffdcad

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

‎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
thrownewERR_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
returnPromiseResolve();
445444
constabortPromise=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
returnkEmptyObject;
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)