1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix(child_process): ignore node experimental option --experimental-*

This commit is contained in:
EdamAmex 2024-10-17 10:14:48 +00:00
parent a61ba3c699
commit ee438b636b
3 changed files with 20 additions and 0 deletions

View file

@ -134,6 +134,8 @@ export function fork(
execArgv.splice(index, rm);
} else if (flag.startsWith("--no-warnings")) {
execArgv[index] = "--quiet";
} else if (flag.startsWith("--experimental")) {
// Do Nothing
} else {
index++;
}

View file

@ -1193,6 +1193,8 @@ function toDenoArgs(args: string[]): string[] {
if (flagInfo === undefined) {
if (arg === "--no-warnings") {
denoArgs.push("--quiet");
} else if (arg.startsWith("--experimental")) {
// Do Nothing
} else {
// Not a known flag that expects a value. Just copy it to the output.
denoArgs.push(arg);

View file

@ -1061,3 +1061,19 @@ Deno.test(async function noWarningsFlag() {
await timeout.promise;
});
Deno.test(async function experimentalFlag() {
const code = ``;
const file = await Deno.makeTempFile();
await Deno.writeTextFile(file, code);
const timeout = withTimeout<void>();
const child = CP.fork(file, [], {
execArgv: ["--experimental-vm-modules"],
stdio: ["inherit", "inherit", "inherit", "ipc"],
});
child.on("close", () => {
timeout.resolve();
});
await timeout.promise;
});