Skip to content

Commit

Permalink
process: update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ShogunPanda committed Jan 8, 2025
1 parent 037edbc commit e56bf2d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -3321,7 +3321,8 @@ This is achieved by using the `execve` Unix function and therefore no memory or
resources from the current process are preserved, except for the standard input,
standard output and standard error file descriptor.
All other resources are discarded by system when the processes are swapped.
All other resources are discarded by the system when the processes are swapped, without triggering
any exit or close events and without running any cleanup handler.
This function will never return, unless an error occurred.
Expand Down
5 changes: 2 additions & 3 deletions test/parallel/test-process-execve-on-exit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const { isMainThread, mustCall, mustNotCall, skip, isWindows } = require('../common');
const { isMainThread, mustNotCall, skip, isWindows } = require('../common');
const { strictEqual } = require('assert');

if (!isMainThread) {
Expand All @@ -10,9 +10,8 @@ if (!isMainThread) {
}

if (process.argv[2] === 'replaced') {
process.on('beforeExit', mustCall());
strictEqual(process.argv[2], 'replaced');
} else {
process.on('beforeExit', mustNotCall());
process.on('exit', mustNotCall());
process.execve(process.execPath, [__filename, 'replaced']);
}
1 change: 1 addition & 0 deletions test/parallel/test-process-execve-socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if (process.argv[2] === 'replaced') {
// Create a new socket server
const server = createServer();

server.on('close', mustNotCall());
server.listen(0, mustCall(() => {
const port = server.address().port;

Expand Down

0 comments on commit e56bf2d

Please sign in to comment.