From fa1253200098f4959372c0a195f867da576b7522 Mon Sep 17 00:00:00 2001 From: ZYSzys <17367077526@163.com> Date: Fri, 26 Oct 2018 23:24:01 +0800 Subject: [PATCH] lib: remove useless cwd in posix.resolve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/23902 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat Reviewed-By: Tobias Nießen Reviewed-By: James M Snell --- lib/path.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/path.js b/lib/path.js index 17a7f0cadfce87..4b34ef2e4fa442 100644 --- a/lib/path.js +++ b/lib/path.js @@ -1156,16 +1156,13 @@ const posix = { resolve: function resolve() { var resolvedPath = ''; var resolvedAbsolute = false; - var cwd; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path; if (i >= 0) path = arguments[i]; else { - if (cwd === undefined) - cwd = process.cwd(); - path = cwd; + path = process.cwd(); } assertPath(path);