From 18b89d948dcb849c4dc577478794c3d5fb23b597 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Thu, 12 Sep 2024 12:24:58 -0700 Subject: fix(ext/node): Implement detached option in `child_process` (#25218) Fixes https://github.com/denoland/deno/issues/25193. --- runtime/js/40_process.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'runtime/js') diff --git a/runtime/js/40_process.js b/runtime/js/40_process.js index 358805180..ac9411916 100644 --- a/runtime/js/40_process.js +++ b/runtime/js/40_process.js @@ -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, -- cgit v1.2.3