summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/process.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/process.ts')
-rw-r--r--ext/node/polyfills/process.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts
index 2dc10d7b1..b676e87d7 100644
--- a/ext/node/polyfills/process.ts
+++ b/ext/node/polyfills/process.ts
@@ -91,7 +91,7 @@ export const exit = (code?: number | string) => {
process.emit("exit", process.exitCode || 0);
}
- Deno.exit(process.exitCode || 0);
+ process.reallyExit(process.exitCode || 0);
};
function addReadOnlyProcessAlias(
@@ -380,6 +380,13 @@ class Process extends EventEmitter {
/** https://nodejs.org/api/process.html#process_process_exit_code */
exit = exit;
+ // Undocumented Node API that is used by `signal-exit` which in turn
+ // is used by `node-tap`. It was marked for removal a couple of years
+ // ago. See https://github.com/nodejs/node/blob/6a6b3c54022104cc110ab09044a2a0cecb8988e7/lib/internal/bootstrap/node.js#L172
+ reallyExit = (code: number) => {
+ return Deno.exit(code || 0);
+ };
+
_exiting = _exiting;
/** https://nodejs.org/api/process.html#processexitcode_1 */