File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,21 @@ function tryRepeatedTimer() {
59
59
if ( ++ n < N )
60
60
setTimeout ( repeatedTimer , 1 ) ;
61
61
else // n == N
62
- process . once ( 'beforeExit' , common . mustCall ( tryNextTick ) ) ;
62
+ process . once ( 'beforeExit' , common . mustCall ( tryNextTickSetImmediate ) ) ;
63
63
} , N ) ;
64
64
setTimeout ( repeatedTimer , 1 ) ;
65
65
}
66
66
67
67
// Test if the callback of `process.nextTick` can be invoked.
68
+ function tryNextTickSetImmediate ( ) {
69
+ process . nextTick ( common . mustCall ( function ( ) {
70
+ setImmediate ( common . mustCall ( ( ) => {
71
+ process . once ( 'beforeExit' , common . mustCall ( tryNextTick ) ) ;
72
+ } ) ) ;
73
+ } ) ) ;
74
+ }
75
+
76
+ // Test that `process.nextTick` won't keep the event loop running by itself.
68
77
function tryNextTick ( ) {
69
78
process . nextTick ( common . mustCall ( function ( ) {
70
79
process . once ( 'beforeExit' , common . mustNotCall ( ) ) ;
You can’t perform that action at this time.
0 commit comments