Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoli Papirovski <apapirovski@mac.com>2017-10-17 01:37:14 +0300
committerAnatoli Papirovski <apapirovski@mac.com>2017-10-19 20:54:14 +0300
commit3c0ebf5aca935ebacf4f5b862c2ad4fb67614bcb (patch)
tree84859056d1bd5a434d64e7baa4f0f1aca0f96bad /lib/path.js
parentbf1bacef6bc49fa39a272ca63b7635de3e5e7f08 (diff)
tools: enable additional eslint rules
Enable additional rules that node either already adheres to or it makes sense to do so going forward: for-direction, accessor-pairs, no-lonely-if and symbol-description. Fix all instances of no-lonely-if in lib & test and disable accessor-pairs in test-util-inspect. PR-URL: https://github.com/nodejs/node/pull/16243 Refs: https://eslint.org/docs/rules/for-direction Refs: https://eslint.org/docs/rules/accessor-pairs Refs: https://eslint.org/docs/rules/no-lonely-if Refs: https://eslint.org/docs/rules/symbol-description Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib/path.js')
-rw-r--r--lib/path.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/path.js b/lib/path.js
index 876e5fd582e..e8dbf4c2eea 100644
--- a/lib/path.js
+++ b/lib/path.js
@@ -455,17 +455,15 @@ const win32 = {
} else {
return '';
}
+ } else if (isAbsolute) {
+ if (tail.length > 0)
+ return device + '\\' + tail;
+ else
+ return device + '\\';
+ } else if (tail.length > 0) {
+ return device + tail;
} else {
- if (isAbsolute) {
- if (tail.length > 0)
- return device + '\\' + tail;
- else
- return device + '\\';
- } else if (tail.length > 0) {
- return device + tail;
- } else {
- return device;
- }
+ return device;
}
},