File tree 4 files changed +7
-21
lines changed
4 files changed +7
-21
lines changed Original file line number Diff line number Diff line change @@ -234,17 +234,6 @@ fail.
234
234
235
235
If ` fn ` is not provided, an empty function will be used.
236
236
237
- ### mustCallAsync([ fn] [ , exact ] )
238
- * ` fn ` [ < ; Function>]
239
- * ` exact ` [ < ; number>] default = 1
240
- * return [ < ; Function>]
241
-
242
- The same as ` mustCall() ` , except that it is also checked that the Promise
243
- returned by the function is fulfilled for each invocation of the function.
244
-
245
- The return value of the wrapped function is the return value of the original
246
- function, if necessary wrapped as a promise.
247
-
248
237
### mustCallAtLeast([ fn] [ , minimum ] )
249
238
* ` fn ` [ < ; Function>] default = () => {}
250
239
* ` minimum ` [ < ; number>] default = 1
Original file line number Diff line number Diff line change @@ -308,12 +308,6 @@ function mustCallAtLeast(fn, minimum) {
308
308
return _mustCallInner ( fn , minimum , 'minimum' ) ;
309
309
}
310
310
311
- function mustCallAsync ( fn , exact ) {
312
- return mustCall ( ( ...args ) => {
313
- return Promise . resolve ( fn ( ...args ) ) . then ( mustCall ( ( val ) => val ) ) ;
314
- } , exact ) ;
315
- }
316
-
317
311
function _mustCallInner ( fn , criteria = 1 , field ) {
318
312
if ( process . _exiting )
319
313
throw new Error ( 'Cannot use common.mustCall*() in process exit handler' ) ;
@@ -722,7 +716,6 @@ module.exports = {
722
716
isWindows,
723
717
localIPv6Hosts,
724
718
mustCall,
725
- mustCallAsync,
726
719
mustCallAtLeast,
727
720
mustNotCall,
728
721
nodeProcessAborted,
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ const {
26
26
allowGlobals,
27
27
mustCall,
28
28
mustCallAtLeast,
29
- mustCallAsync,
30
29
hasMultiLocalhost,
31
30
skipIfEslintMissing,
32
31
canCreateSymLink,
@@ -74,7 +73,6 @@ export {
74
73
allowGlobals ,
75
74
mustCall ,
76
75
mustCallAtLeast ,
77
- mustCallAsync ,
78
76
hasMultiLocalhost ,
79
77
skipIfEslintMissing ,
80
78
canCreateSymLink ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const makeDuplexPair = require('../common/duplexpair');
12
12
{
13
13
let req ;
14
14
const server = http2 . createServer ( ) ;
15
- server . on ( 'stream' , common . mustCallAsync ( async ( stream , headers ) => {
15
+ server . on ( 'stream' , mustCallAsync ( async ( stream , headers ) => {
16
16
stream . respond ( {
17
17
'content-type' : 'text/html' ,
18
18
':status' : 200
@@ -45,3 +45,9 @@ function event(ee, eventName) {
45
45
ee . once ( eventName , common . mustCall ( resolve ) ) ;
46
46
} ) ;
47
47
}
48
+
49
+ function mustCallAsync ( fn , exact ) {
50
+ return common . mustCall ( ( ...args ) => {
51
+ return Promise . resolve ( fn ( ...args ) ) . then ( common . mustCall ( ( val ) => val ) ) ;
52
+ } , exact ) ;
53
+ }
You can’t perform that action at this time.
0 commit comments