Skip to content

Commit

Permalink
fix: util.parseArgs() missing node:process import
Browse files Browse the repository at this point in the history
fix parseArgs() not working due to missing import of node:process

this commit fixes issue denoland#22363
  • Loading branch information
javihernant committed Feb 15, 2024
1 parent 052b7d8 commit 7146c0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ext/node/polyfills/internal/util/parse_args/parse_args.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
7 changes: 7 additions & 0 deletions tests/unit_node/util_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,10 @@ Deno.test({
);
},
});

Deno.test({
name: "[util] parseArgs() with no args works",
fn() {
util.parseArgs({});
},
});

0 comments on commit 7146c0d

Please sign in to comment.