@@ -43,12 +43,11 @@ const {
43
43
} = require ( 'internal/errors' ) ;
44
44
const {
45
45
converters,
46
+ createInterfaceConverter,
46
47
createSequenceConverter,
47
48
} = require ( 'internal/webidl' ) ;
48
49
49
50
const {
50
- validateAbortSignal,
51
- validateAbortSignalArray,
52
51
validateObject,
53
52
validateUint32,
54
53
kValidateObjectAllowObjects,
@@ -225,11 +224,11 @@ class AbortSignal extends EventTarget {
225
224
* @returns {AbortSignal }
226
225
*/
227
226
static any ( signals ) {
228
- const signalsArray = createSequenceConverter (
229
- converters . any ,
230
- ) ( signals ) ;
227
+ const signalsArray = converters [ 'sequence<AbortSignal>' ] (
228
+ signals ,
229
+ { __proto__ : null , context : 'signals' } ,
230
+ ) ;
231
231
232
- validateAbortSignalArray ( signalsArray , 'signals' ) ;
233
232
const resultSignal = new AbortSignal ( kDontThrowSymbol , { composite : true } ) ;
234
233
if ( ! signalsArray . length ) {
235
234
return resultSignal ;
@@ -349,6 +348,9 @@ class AbortSignal extends EventTarget {
349
348
}
350
349
}
351
350
351
+ converters . AbortSignal = createInterfaceConverter ( 'AbortSignal' , AbortSignal . prototype ) ;
352
+ converters [ 'sequence<AbortSignal>' ] = createSequenceConverter ( converters . AbortSignal ) ;
353
+
352
354
function ClonedAbortSignal ( ) {
353
355
return new AbortSignal ( kDontThrowSymbol , { transferable : true } ) ;
354
356
}
@@ -466,10 +468,7 @@ function transferableAbortController() {
466
468
* @returns {Promise<void> }
467
469
*/
468
470
async function aborted ( signal , resource ) {
469
- if ( signal === undefined ) {
470
- throw new ERR_INVALID_ARG_TYPE ( 'signal' , 'AbortSignal' , signal ) ;
471
- }
472
- validateAbortSignal ( signal , 'signal' ) ;
471
+ converters . AbortSignal ( signal , { __proto__ : null , context : 'signal' } ) ;
473
472
validateObject ( resource , 'resource' , kValidateObjectAllowObjects ) ;
474
473
if ( signal . aborted )
475
474
return PromiseResolve ( ) ;
0 commit comments