diff options
author | Geert-Jan Zwiers <geertjanzwiers@protonmail.com> | 2023-03-20 14:24:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-20 13:24:43 +0000 |
commit | d78db7c0910aded010c2faee9a8c0f128f513985 (patch) | |
tree | fa20954790a679d31f003ecfe248e4857c394fa6 | |
parent | aba5329aec06a92b591ef92ddc40ac0d25c870fa (diff) |
fix(ext/node): use Deno.Command from `ext:runtime` (#18289)
Fixes https://github.com/denoland/deno/issues/18281.
This imports `Deno.Command` from `ext:runtime/40_process.js` instead of
using `Deno[Deno.internal]?.nodeUnstable?.Command`.
-rw-r--r-- | ext/node/polyfills/process.ts | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts index 1470f9eb2..1f1702785 100644 --- a/ext/node/polyfills/process.ts +++ b/ext/node/polyfills/process.ts @@ -36,6 +36,7 @@ import { } from "ext:deno_node/_next_tick.ts"; import { isWindows } from "ext:deno_node/_util/os.ts"; import * as io from "ext:deno_io/12_io.js"; +import { Command } from "ext:runtime/40_process.js"; // TODO(kt3k): This should be set at start up time export let arch = ""; @@ -61,10 +62,6 @@ import * as uv from "ext:deno_node/internal_binding/uv.ts"; import type { BindingName } from "ext:deno_node/internal_binding/mod.ts"; import { buildAllowedFlags } from "ext:deno_node/internal/process/per_thread.mjs"; -// @ts-ignore Deno[Deno.internal] is used on purpose here -const DenoCommand = Deno[Deno.internal]?.nodeUnstable?.Command || - Deno.Command; - const notImplementedEvents = [ "disconnect", "message", @@ -272,11 +269,11 @@ function _kill(pid: number, sig: number): number { if (sig === 0) { let status; if (Deno.build.os === "windows") { - status = (new DenoCommand("powershell.exe", { + status = (new Command("powershell.exe", { args: ["Get-Process", "-pid", pid], })).outputSync(); } else { - status = (new DenoCommand("kill", { + status = (new Command("kill", { args: ["-0", pid], })).outputSync(); } |