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:
parent
01bc2f530e
commit
7542d1050a
3 changed files with 32 additions and 0 deletions
|
@ -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(","));
|
||||
|
|
|
@ -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(
|
||||
|
|
1
tests/unit_node/testdata/node_modules/foo/check_argv.js
generated
vendored
Normal file
1
tests/unit_node/testdata/node_modules/foo/check_argv.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
console.log(process.argv.length);
|
Loading…
Reference in a new issue