File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,10 @@ function wrapProcessMethods(binding) {
149
149
process . _exiting = true ;
150
150
process . emit ( 'exit' , process . exitCode || 0 ) ;
151
151
}
152
- binding . reallyExit ( process . exitCode || 0 ) ;
152
+ // FIXME(joyeecheung): This is an undocumented API that gets monkey-patched
153
+ // in the user land. Either document it, or deprecate it in favor of a
154
+ // better public alternative.
155
+ process . reallyExit ( process . exitCode || 0 ) ;
153
156
}
154
157
155
158
function kill ( pid , sig ) {
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+ require ( '../common' ) ;
3
+ const assert = require ( 'assert' ) ;
4
+
5
+ // ensure that the reallyExit hook is executed.
6
+ // see: https://github.com/nodejs/node/issues/25650
7
+ if ( process . argv [ 2 ] === 'subprocess' ) {
8
+ process . reallyExit = function ( ) {
9
+ console . info ( 'really exited' ) ;
10
+ } ;
11
+ process . exit ( ) ;
12
+ } else {
13
+ const { spawnSync } = require ( 'child_process' ) ;
14
+ const out = spawnSync ( process . execPath , [ __filename , 'subprocess' ] ) ;
15
+ const observed = out . output [ 1 ] . toString ( 'utf8' ) . trim ( ) ;
16
+ assert . strictEqual ( observed , 'really exited' ) ;
17
+ }
You can’t perform that action at this time.
0 commit comments