mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
process: fix default env for process.execve
The `env` parameter for `process.execve` is documented to default to `process.env`. PR-URL: https://github.com/nodejs/node/pull/60029 Refs: https://github.com/nodejs/build/pull/4156 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
c08164d016
commit
b8ea0e8e85
|
|
@ -279,7 +279,7 @@ function wrapProcessMethods(binding) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function execve(execPath, args = [], env) {
|
||||
function execve(execPath, args = [], env = process.env) {
|
||||
emitExperimentalWarning('process.execve');
|
||||
|
||||
const { isMainThread } = require('internal/worker');
|
||||
|
|
@ -301,7 +301,6 @@ function wrapProcessMethods(binding) {
|
|||
}
|
||||
|
||||
const envArray = [];
|
||||
if (env !== undefined) {
|
||||
validateObject(env, 'env');
|
||||
|
||||
for (const { 0: key, 1: value } of ObjectEntries(env)) {
|
||||
|
|
@ -318,7 +317,6 @@ function wrapProcessMethods(binding) {
|
|||
ArrayPrototypePush(envArray, `${key}=${value}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (execveDiagnosticChannel.hasSubscribers) {
|
||||
execveDiagnosticChannel.publish({ execPath, args, env: envArray });
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user