summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/internal/child_process.ts
diff options
context:
space:
mode:
authorhaturau <135221985+haturatu@users.noreply.github.com>2024-11-20 01:20:47 +0900
committerGitHub <noreply@github.com>2024-11-20 01:20:47 +0900
commit85719a67e59c7aa45bead26e4942d7df8b1b42d4 (patch)
treeface0aecaac53e93ce2f23b53c48859bcf1a36ec /ext/node/polyfills/internal/child_process.ts
parent67697bc2e4a62a9670699fd18ad0dd8efc5bd955 (diff)
parent186b52731c6bb326c4d32905c5e732d082e83465 (diff)
Merge branch 'denoland:main' into main
Diffstat (limited to 'ext/node/polyfills/internal/child_process.ts')
-rw-r--r--ext/node/polyfills/internal/child_process.ts27
1 files changed, 21 insertions, 6 deletions
diff --git a/ext/node/polyfills/internal/child_process.ts b/ext/node/polyfills/internal/child_process.ts
index 6f209b719..cfff1079f 100644
--- a/ext/node/polyfills/internal/child_process.ts
+++ b/ext/node/polyfills/internal/child_process.ts
@@ -1191,8 +1191,12 @@ function toDenoArgs(args: string[]): string[] {
}
if (flagInfo === undefined) {
- // Not a known flag that expects a value. Just copy it to the output.
- denoArgs.push(arg);
+ if (arg === "--no-warnings") {
+ denoArgs.push("--quiet");
+ } else {
+ // Not a known flag that expects a value. Just copy it to the output.
+ denoArgs.push(arg);
+ }
continue;
}
@@ -1335,7 +1339,7 @@ export function setupChannel(target: any, ipc: number) {
}
}
- process.nextTick(handleMessage, msg);
+ nextTick(handleMessage, msg);
}
} catch (err) {
if (
@@ -1396,7 +1400,7 @@ export function setupChannel(target: any, ipc: number) {
if (!target.connected) {
const err = new ERR_IPC_CHANNEL_CLOSED();
if (typeof callback === "function") {
- process.nextTick(callback, err);
+ nextTick(callback, err);
} else {
nextTick(() => target.emit("error", err));
}
@@ -1412,7 +1416,18 @@ export function setupChannel(target: any, ipc: number) {
.then(() => {
control.unrefCounted();
if (callback) {
- process.nextTick(callback, null);
+ nextTick(callback, null);
+ }
+ }, (err: Error) => {
+ control.unrefCounted();
+ if (err instanceof Deno.errors.Interrupted) {
+ // Channel closed on us mid-write.
+ } else {
+ if (typeof callback === "function") {
+ nextTick(callback, err);
+ } else {
+ nextTick(() => target.emit("error", err));
+ }
}
});
return queueOk[0];
@@ -1429,7 +1444,7 @@ export function setupChannel(target: any, ipc: number) {
target.connected = false;
target[kCanDisconnect] = false;
control[kControlDisconnect]();
- process.nextTick(() => {
+ nextTick(() => {
target.channel = null;
core.close(ipc);
target.emit("disconnect");