From 37a546b490342797a9fd4338fe8aa211e377af30 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 9 Jan 2016 20:59:54 -0800 Subject: [PATCH] src: remove redeclarations of variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Michaël Zasso Reviewed-By: Johan Bergström Reviewed-By: James M Snell --- src/node.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/node.js b/src/node.js index d63ffac8b705fe..993e596ba6140d 100644 --- a/src/node.js +++ b/src/node.js @@ -63,13 +63,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 if (process.profProcess) { NativeModule.require('internal/v8_prof_processor'); @@ -142,8 +140,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 @@ -592,7 +588,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);