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 <tniessen@tnie.de>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
  • Loading branch information
sosoba authored and MoLow committed Jul 6, 2023
1 parent 8bcfcc0 commit b34eaf3
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 @@ -164,7 +164,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 @@ -1094,8 +1094,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 b34eaf3

Please sign in to comment.