| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 55768c0 commit b2834ce
2 files 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 | |
|---|---|---|---|
@@ -0,0 +1,17 @@ | |||
| 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 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments