mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(ext/node): Implement detached option in child_process
(#25218)
Fixes https://github.com/denoland/deno/issues/25193.
This commit is contained in:
parent
3f15e30062
commit
18b89d948d
8 changed files with 136 additions and 20 deletions
|
@ -157,6 +157,10 @@ function run({
|
|||
return new Process(res);
|
||||
}
|
||||
|
||||
export const kExtraStdio = Symbol("extraStdio");
|
||||
export const kIpc = Symbol("ipc");
|
||||
export const kDetached = Symbol("detached");
|
||||
|
||||
const illegalConstructorKey = Symbol("illegalConstructorKey");
|
||||
|
||||
function spawnChildInner(command, apiName, {
|
||||
|
@ -166,13 +170,14 @@ function spawnChildInner(command, apiName, {
|
|||
env = { __proto__: null },
|
||||
uid = undefined,
|
||||
gid = undefined,
|
||||
signal = undefined,
|
||||
stdin = "null",
|
||||
stdout = "piped",
|
||||
stderr = "piped",
|
||||
signal = undefined,
|
||||
windowsRawArguments = false,
|
||||
ipc = -1,
|
||||
extraStdio = [],
|
||||
[kDetached]: detached = false,
|
||||
[kExtraStdio]: extraStdio = [],
|
||||
[kIpc]: ipc = -1,
|
||||
} = { __proto__: null }) {
|
||||
const child = op_spawn_child({
|
||||
cmd: pathFromURL(command),
|
||||
|
@ -188,6 +193,7 @@ function spawnChildInner(command, apiName, {
|
|||
windowsRawArguments,
|
||||
ipc,
|
||||
extraStdio,
|
||||
detached,
|
||||
}, apiName);
|
||||
return new ChildProcess(illegalConstructorKey, {
|
||||
...child,
|
||||
|
@ -414,6 +420,7 @@ function spawnSync(command, {
|
|||
stderr,
|
||||
windowsRawArguments,
|
||||
extraStdio: [],
|
||||
detached: false,
|
||||
});
|
||||
return {
|
||||
success: result.status.success,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue