Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 37a546b

Browse filesBrowse files
TrottMyles Borins
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 <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>
1 parent b14b2ae commit 37a546b
Copy full SHA for 37a546b

File tree

Expand file treeCollapse file tree

1 file changed

+3
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-7
lines changed
Open diff view settings
Collapse file

‎src/node.js‎

Copy file name to clipboardExpand all lines: src/node.js
+3-7Lines changed: 3 additions & 7 deletions
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
@@ -592,7 +588,7 @@
592588
// getcwd(3) can fail if the current working directory has been deleted.
593589
// Fall back to the directory name of the (absolute) executable path.
594590
// It's not really correct but what are the alternatives?
595-
var cwd = path.dirname(process.execPath);
591+
cwd = path.dirname(process.execPath);
596592
}
597593

598594
var module = new Module(name);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.