summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/internal/child_process.ts
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-12-30 11:02:30 +0530
committerGitHub <noreply@github.com>2023-12-30 05:32:30 +0000
commita7b21760fce4780671db1d3d534b1d0d3c121ce7 (patch)
treed4c2d527c68e971c42b13b126913e84b1aafd3a0 /ext/node/polyfills/internal/child_process.ts
parent4de9ddcf210e68ef81fcb00261a2c928b1650740 (diff)
chore(runtime): internalize pipe fd for ext/node (#21570)
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'ext/node/polyfills/internal/child_process.ts')
-rw-r--r--ext/node/polyfills/internal/child_process.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/node/polyfills/internal/child_process.ts b/ext/node/polyfills/internal/child_process.ts
index 7f40ce94b..30b15fb62 100644
--- a/ext/node/polyfills/internal/child_process.ts
+++ b/ext/node/polyfills/internal/child_process.ts
@@ -6,6 +6,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
+import { core, internals } from "ext:core/mod.js";
import { assert } from "ext:deno_node/_util/asserts.ts";
import { EventEmitter } from "node:events";
import { os } from "ext:deno_node/internal_binding/constants.ts";
@@ -43,6 +44,7 @@ import {
import { kEmptyObject } from "ext:deno_node/internal/util.mjs";
import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
import process from "node:process";
+
const core = globalThis.__bootstrap.core;
const {
op_node_ipc_read,
@@ -258,8 +260,9 @@ export class ChildProcess extends EventEmitter {
}
}
- if (typeof this.#process._pipeFd == "number") {
- setupChannel(this, this.#process._pipeFd);
+ const pipeFd = internals.getPipeFd(this.#process);
+ if (typeof pipeFd == "number") {
+ setupChannel(this, pipeFd);
}
(async () => {