Skip to content

Commit 53cc978

Browse files
Trottjasnell
authored andcommitted
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 bfc4823 commit 53cc978

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
@@ -63,13 +63,11 @@
6363

6464
} else if (process.argv[1] == 'debug') {
6565
// Start the debugger agent
66-
var d = NativeModule.require('_debugger');
67-
d.start();
66+
NativeModule.require('_debugger').start();
6867

6968
} else if (process.argv[1] == '--debug-agent') {
7069
// Start the debugger agent
71-
var d = NativeModule.require('_debug_agent');
72-
d.start();
70+
NativeModule.require('_debug_agent').start();
7371

7472
} else if (process.profProcess) {
7573
NativeModule.require('internal/v8_prof_processor');
@@ -142,8 +140,6 @@
142140
}
143141

144142
} else {
145-
var Module = NativeModule.require('module');
146-
147143
// If -i or --interactive were passed, or stdin is a TTY.
148144
if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
149145
// REPL
@@ -594,7 +590,7 @@
594590
// getcwd(3) can fail if the current working directory has been deleted.
595591
// Fall back to the directory name of the (absolute) executable path.
596592
// It's not really correct but what are the alternatives?
597-
var cwd = path.dirname(process.execPath);
593+
cwd = path.dirname(process.execPath);
598594
}
599595

600596
var module = new Module(name);

0 commit comments

Comments
 (0)