summaryrefslogtreecommitdiff
path: root/runtime/js/40_process.js
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 /runtime/js/40_process.js
parent4de9ddcf210e68ef81fcb00261a2c928b1650740 (diff)
chore(runtime): internalize pipe fd for ext/node (#21570)
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'runtime/js/40_process.js')
-rw-r--r--runtime/js/40_process.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/runtime/js/40_process.js b/runtime/js/40_process.js
index 9239f8e99..2a97f81a3 100644
--- a/runtime/js/40_process.js
+++ b/runtime/js/40_process.js
@@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { core, primordials } from "ext:core/mod.js";
+import { core, internals, primordials } from "ext:core/mod.js";
const ops = core.ops;
const {
ArrayPrototypeMap,
@@ -204,16 +204,16 @@ function collectOutput(readableStream) {
return readableStreamCollectIntoUint8Array(readableStream);
}
+const _pipeFd = Symbol("[[pipeFd]]");
+
+internals.getPipeFd = (process) => process[_pipeFd];
+
class ChildProcess {
#rid;
#waitPromise;
#waitComplete = false;
- #pipeFd;
- // internal, used by ext/node
- get _pipeFd() {
- return this.#pipeFd;
- }
+ [_pipeFd];
#pid;
get pid() {
@@ -259,7 +259,7 @@ class ChildProcess {
this.#rid = rid;
this.#pid = pid;
- this.#pipeFd = pipeFd;
+ this[_pipeFd] = pipeFd;
if (stdinRid !== null) {
this.#stdin = writableStreamForRid(stdinRid);