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

fix(ext/node): strip --enable-source-maps from argv (#22743)

Fixes https://github.com/denoland/deno/issues/21750
This commit is contained in:
Divy Srivastava 2024-03-06 19:10:47 +05:30 committed by GitHub
parent 01bc2f530e
commit 7542d1050a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 0 deletions

View file

@ -120,9 +120,13 @@ export function fork(
if (flag.startsWith("--max-old-space-size")) {
execArgv.splice(index, 1);
v8Flags.push(flag);
} else if (flag.startsWith("--enable-source-maps")) {
// https://github.com/denoland/deno/issues/21750
execArgv.splice(index, 1);
}
}
}
const stringifiedV8Flags: string[] = [];
if (v8Flags.length > 0) {
stringifiedV8Flags.push("--v8-flags=" + v8Flags.join(","));

View file

@ -755,6 +755,33 @@ Deno.test(async function forkIpcKillDoesNotHang() {
await p.promise;
});
Deno.test(async function stripForkEnableSourceMaps() {
const testdataDir = path.join(
path.dirname(path.fromFileUrl(import.meta.url)),
"testdata",
);
const script = path.join(
testdataDir,
"node_modules",
"foo",
"check_argv.js",
);
const p = Promise.withResolvers<void>();
const cp = CP.fork(script, [], {
cwd: testdataDir,
stdio: "pipe",
execArgv: ["--enable-source-maps"],
});
let output = "";
cp.on("close", () => p.resolve());
cp.stdout?.on("data", (data) => {
output += data;
cp.kill();
});
await p.promise;
assertEquals(output, "2\n");
});
Deno.test(async function execFileWithUndefinedTimeout() {
const { promise, resolve, reject } = Promise.withResolvers<void>();
CP.execFile(

View file

@ -0,0 +1 @@
console.log(process.argv.length);