Browse Source

src: remove redeclarations of variables

Remove redeclarations of variables in node.js. This includes removing
one apparently unnecessary `NativeModule.require('module')`.

PR-URL: https://github.com/nodejs/node/pull/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>
process-exit-stdio-flushing
Rich Trott 9 years ago
committed by James M Snell
parent
commit
53cc9785ab
  1. 10
      src/node.js

10
src/node.js

@ -63,13 +63,11 @@
} else if (process.argv[1] == 'debug') { } else if (process.argv[1] == 'debug') {
// Start the debugger agent // Start the debugger agent
var d = NativeModule.require('_debugger'); NativeModule.require('_debugger').start();
d.start();
} else if (process.argv[1] == '--debug-agent') { } else if (process.argv[1] == '--debug-agent') {
// Start the debugger agent // Start the debugger agent
var d = NativeModule.require('_debug_agent'); NativeModule.require('_debug_agent').start();
d.start();
} else if (process.profProcess) { } else if (process.profProcess) {
NativeModule.require('internal/v8_prof_processor'); NativeModule.require('internal/v8_prof_processor');
@ -142,8 +140,6 @@
} }
} else { } else {
var Module = NativeModule.require('module');
// If -i or --interactive were passed, or stdin is a TTY. // If -i or --interactive were passed, or stdin is a TTY.
if (process._forceRepl || NativeModule.require('tty').isatty(0)) { if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
// REPL // REPL
@ -594,7 +590,7 @@
// getcwd(3) can fail if the current working directory has been deleted. // getcwd(3) can fail if the current working directory has been deleted.
// Fall back to the directory name of the (absolute) executable path. // Fall back to the directory name of the (absolute) executable path.
// It's not really correct but what are the alternatives? // 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); var module = new Module(name);

Loading…
Cancel
Save