Skip to content

Commit b7def8e

Browse files
authored
path: indicate index of wrong resolve() parameter
PR-URL: #47660 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Deokjin Kim <[email protected]>
1 parent 3bca5c2 commit b7def8e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/path.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ const win32 = {
168168
let path;
169169
if (i >= 0) {
170170
path = args[i];
171-
validateString(path, 'path');
171+
validateString(path, `paths[${i}]`);
172172

173173
// Skip empty entries
174174
if (path.length === 0) {
@@ -1098,8 +1098,7 @@ const posix = {
10981098

10991099
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
11001100
const path = i >= 0 ? args[i] : posixCwd();
1101-
1102-
validateString(path, 'path');
1101+
validateString(path, `paths[${i}]`);
11031102

11041103
// Skip empty entries
11051104
if (path.length === 0) {

0 commit comments

Comments
 (0)