Skip to content

Commit

Permalink
path: indicate index of wrong resolve() parameter
Browse files Browse the repository at this point in the history
PR-URL: #47660
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
  • Loading branch information
sosoba authored May 4, 2023
1 parent 3bca5c2 commit b7def8e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const win32 = {
let path;
if (i >= 0) {
path = args[i];
validateString(path, 'path');
validateString(path, `paths[${i}]`);

// Skip empty entries
if (path.length === 0) {
Expand Down Expand Up @@ -1098,8 +1098,7 @@ const posix = {

for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
const path = i >= 0 ? args[i] : posixCwd();

validateString(path, 'path');
validateString(path, `paths[${i}]`);

// Skip empty entries
if (path.length === 0) {
Expand Down

0 comments on commit b7def8e

Please sign in to comment.