module: refactor redeclared variable
authorRich Trott <rtrott@gmail.com>
Sat, 30 Jan 2016 03:45:20 +0000 (19:45 -0800)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
`homedir` was declared with `var` twice in the same scope in
`lib/module.js`. This change makes it a single declaration.

PR-URL: https://github.com/nodejs/node/pull/4962
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
lib/module.js

index 7e3a1a0..141ee18 100644 (file)
@@ -446,10 +446,11 @@ Module.runMain = function() {
 Module._initPaths = function() {
   const isWindows = process.platform === 'win32';
 
+  var homeDir;
   if (isWindows) {
-    var homeDir = process.env.USERPROFILE;
+    homeDir = process.env.USERPROFILE;
   } else {
-    var homeDir = process.env.HOME;
+    homeDir = process.env.HOME;
   }
 
   var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')];