-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
child_process: allow URL
instances as paths to executables
#49031
base: main
Are you sure you want to change the base?
Changes from all commits
29fc263
79ae91a
d7aaae1
71a2fef
d25509f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,7 @@ let addAbortListener; | |
* cwd?: string | URL; | ||
* detached?: boolean; | ||
* env?: Record<string, string>; | ||
* execPath?: string; | ||
* execPath?: string | URL; | ||
* execArgv?: string[]; | ||
* gid?: number; | ||
* serialization?: string; | ||
|
@@ -302,7 +302,7 @@ function normalizeExecFileArgs(file, args, options, callback) { | |
|
||
/** | ||
* Spawns the specified file as a shell. | ||
* @param {string} file | ||
* @param {string | URL} file | ||
* @param {string[]} [args] | ||
* @param {{ | ||
* cwd?: string | URL; | ||
|
@@ -545,8 +545,8 @@ function copyProcessEnvToEnv(env, name, optionEnv) { | |
} | ||
|
||
function normalizeSpawnArguments(file, args, options) { | ||
file = getValidatedPath(file, 'file'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice catch! I guess it should be restricted to string or stringified URL, at least for now. |
||
validateString(file, 'file'); | ||
validateArgumentNullCheck(file, 'file'); | ||
|
||
if (file.length === 0) | ||
throw new ERR_INVALID_ARG_VALUE('file', file, 'cannot be empty'); | ||
|
@@ -730,7 +730,7 @@ function abortChildProcess(child, killSignal, reason) { | |
|
||
/** | ||
* Spawns a new process using the given `file`. | ||
* @param {string} file | ||
* @param {string | URL} file | ||
* @param {string[]} [args] | ||
* @param {{ | ||
* cwd?: string | URL; | ||
|
@@ -800,7 +800,7 @@ function spawn(file, args, options) { | |
|
||
/** | ||
* Spawns a new process synchronously using the given `file`. | ||
* @param {string} file | ||
* @param {string | URL} file | ||
* @param {string[]} [args] | ||
* @param {{ | ||
* cwd?: string | URL; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word
object
hints towards an actual javascript object withURL
class properties, but there isn't any test to check towards it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isURL()
is duck-typed:node/lib/internal/url.js
Lines 761 to 763 in d150316
so it probably makes sense? The same term is used in other entries here as well.