diff --git a/ext/node/polyfills/internal/util/parse_args/parse_args.js b/ext/node/polyfills/internal/util/parse_args/parse_args.js index 2c208a897d..8abe8a9f8f 100644 --- a/ext/node/polyfills/internal/util/parse_args/parse_args.js +++ b/ext/node/polyfills/internal/util/parse_args/parse_args.js @@ -46,6 +46,8 @@ const { ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL, } = codes; +import process from "node:process"; + function getMainArgs() { // Work out where to slice process.argv for user supplied arguments. diff --git a/tests/unit_node/util_test.ts b/tests/unit_node/util_test.ts index e01226e3a7..85fa727414 100644 --- a/tests/unit_node/util_test.ts +++ b/tests/unit_node/util_test.ts @@ -315,3 +315,10 @@ Deno.test({ ); }, }); + +Deno.test({ + name: "[util] parseArgs() with no args works", + fn() { + util.parseArgs({}); + }, +});