Skip to content

Commit 5990ba2

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
src: remove redeclarations of variables
Remove redeclarations of variables in node.js. This includes removing one apparently unnecessary `NativeModule.require('module')`. PR-URL: #4605 Reviewed-By: Brian White <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 34d9e48 commit 5990ba2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/node.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,11 @@
6161

6262
} else if (process.argv[1] == 'debug') {
6363
// Start the debugger agent
64-
var d = NativeModule.require('_debugger');
65-
d.start();
64+
NativeModule.require('_debugger').start();
6665

6766
} else if (process.argv[1] == '--debug-agent') {
6867
// Start the debugger agent
69-
var d = NativeModule.require('_debug_agent');
70-
d.start();
68+
NativeModule.require('_debug_agent').start();
7169

7270
} else {
7371
// There is user code to be run
@@ -137,8 +135,6 @@
137135
}
138136

139137
} else {
140-
var Module = NativeModule.require('module');
141-
142138
// If -i or --interactive were passed, or stdin is a TTY.
143139
if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
144140
// REPL
@@ -555,7 +551,7 @@
555551
// getcwd(3) can fail if the current working directory has been deleted.
556552
// Fall back to the directory name of the (absolute) executable path.
557553
// It's not really correct but what are the alternatives?
558-
var cwd = path.dirname(process.execPath);
554+
cwd = path.dirname(process.execPath);
559555
}
560556

561557
var module = new Module(name);

0 commit comments

Comments
 (0)