Skip to content

Commit 0c113e8

Browse files
Trottr-52
authored andcommitted
module: refactor redeclared variable
`homedir` was declared with `var` twice in the same scope in `lib/module.js`. This change makes it a single declaration. PR-URL: #4962 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
1 parent 27def4f commit 0c113e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/module.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,11 @@ Module.runMain = function() {
456456
Module._initPaths = function() {
457457
const isWindows = process.platform === 'win32';
458458

459+
var homeDir;
459460
if (isWindows) {
460-
var homeDir = process.env.USERPROFILE;
461+
homeDir = process.env.USERPROFILE;
461462
} else {
462-
var homeDir = process.env.HOME;
463+
homeDir = process.env.HOME;
463464
}
464465

465466
var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')];

0 commit comments

Comments
 (0)