diff options
author | ZYSzys <17367077526@163.com> | 2018-10-26 18:24:01 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-10-30 07:23:52 +0300 |
commit | b255cd48b105b02fb1ee26a8012b764e83a6a419 (patch) | |
tree | 679e17c6da67d77e8591a4628136f73e1c2f5318 | |
parent | 8eb9ecac594f658aebc9e4e5e5e2f172676ba73f (diff) |
lib: remove useless cwd in posix.resolve
PR-URL: https://github.com/nodejs/node/pull/23902
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r-- | lib/path.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/path.js b/lib/path.js index c8d92f14af0..798682ca0f1 100644 --- a/lib/path.js +++ b/lib/path.js @@ -1073,16 +1073,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); |