From 1faac2dce380afa387f08780ae1a79d087b3acf0 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Wed, 31 Jul 2024 16:28:08 +0200 Subject: fix(ext/node): handle node child_process with --v8-options flag (#24804) Makes `v8flags` package from NPM work. --- ext/node/polyfills/internal/child_process.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ext/node/polyfills/internal/child_process.ts') diff --git a/ext/node/polyfills/internal/child_process.ts b/ext/node/polyfills/internal/child_process.ts index 2dcf0e782..0996806d7 100644 --- a/ext/node/polyfills/internal/child_process.ts +++ b/ext/node/polyfills/internal/child_process.ts @@ -1030,6 +1030,7 @@ const kNodeFlagsMap = new Map([ ["--v8-pool-size", kLongArg], ]); const kDenoSubcommands = new Set([ + "add", "bench", "bundle", "cache", @@ -1046,6 +1047,7 @@ const kDenoSubcommands = new Set([ "install", "lint", "lsp", + "publish", "repl", "run", "tasks", @@ -1092,6 +1094,12 @@ function toDenoArgs(args: string[]): string[] { let isLongWithValue = false; let flagValue; + if (flag === "--v8-options") { + // If --v8-options is passed, it should be replaced with --v8-flags="--help". + denoArgs.push("--v8-flags=--help"); + continue; + } + if (flagInfo === undefined) { // If the flag was not found, it's either not a known flag or it's a long // flag containing an '='. -- cgit v1.2.3