Skip to content

Commit

Permalink
src: remove redeclarations of variables
Browse files Browse the repository at this point in the history
Remove redeclarations of variables in node.js. This includes removing
one apparently unnecessary `NativeModule.require('module')`.

PR-URL: #4605
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and Myles Borins committed Feb 15, 2016
1 parent 34d9e48 commit 5990ba2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@

} else if (process.argv[1] == 'debug') {
// Start the debugger agent
var d = NativeModule.require('_debugger');
d.start();
NativeModule.require('_debugger').start();

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

} else {
// There is user code to be run
Expand Down Expand Up @@ -137,8 +135,6 @@
}

} else {
var Module = NativeModule.require('module');

// If -i or --interactive were passed, or stdin is a TTY.
if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
// REPL
Expand Down Expand Up @@ -555,7 +551,7 @@
// getcwd(3) can fail if the current working directory has been deleted.
// Fall back to the directory name of the (absolute) executable path.
// It's not really correct but what are the alternatives?
var cwd = path.dirname(process.execPath);
cwd = path.dirname(process.execPath);
}

var module = new Module(name);
Expand Down

0 comments on commit 5990ba2

Please sign in to comment.