mirror of
https://github.com/denoland/deno.git
synced 2024-11-28 16:20:57 -05:00
fix(child_process): ignore node experimental option --experimental-*
This commit is contained in:
parent
a61ba3c699
commit
ee438b636b
3 changed files with 20 additions and 0 deletions
|
@ -134,6 +134,8 @@ export function fork(
|
||||||
execArgv.splice(index, rm);
|
execArgv.splice(index, rm);
|
||||||
} else if (flag.startsWith("--no-warnings")) {
|
} else if (flag.startsWith("--no-warnings")) {
|
||||||
execArgv[index] = "--quiet";
|
execArgv[index] = "--quiet";
|
||||||
|
} else if (flag.startsWith("--experimental")) {
|
||||||
|
// Do Nothing
|
||||||
} else {
|
} else {
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1193,6 +1193,8 @@ function toDenoArgs(args: string[]): string[] {
|
||||||
if (flagInfo === undefined) {
|
if (flagInfo === undefined) {
|
||||||
if (arg === "--no-warnings") {
|
if (arg === "--no-warnings") {
|
||||||
denoArgs.push("--quiet");
|
denoArgs.push("--quiet");
|
||||||
|
} else if (arg.startsWith("--experimental")) {
|
||||||
|
// Do Nothing
|
||||||
} else {
|
} else {
|
||||||
// Not a known flag that expects a value. Just copy it to the output.
|
// Not a known flag that expects a value. Just copy it to the output.
|
||||||
denoArgs.push(arg);
|
denoArgs.push(arg);
|
||||||
|
|
|
@ -1061,3 +1061,19 @@ Deno.test(async function noWarningsFlag() {
|
||||||
|
|
||||||
await timeout.promise;
|
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;
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in a new issue