From 8f7189f3d44287841e5ed6001359215002cb073f Mon Sep 17 00:00:00 2001 From: sosoba Date: Thu, 4 May 2023 16:03:20 +0200 Subject: [PATCH] path: indicate index of wrong resolve() parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/47660 Reviewed-By: Tobias Nießen Reviewed-By: Deokjin Kim --- lib/path.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/path.js b/lib/path.js index 351a3e81a3bfc0..d1bef35355af73 100644 --- a/lib/path.js +++ b/lib/path.js @@ -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) { @@ -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) {