From d78db7c0910aded010c2faee9a8c0f128f513985 Mon Sep 17 00:00:00 2001 From: Geert-Jan Zwiers Date: Mon, 20 Mar 2023 14:24:43 +0100 Subject: 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`. --- ext/node/polyfills/process.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ext') 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(); } -- cgit v1.2.3