Skip to content

Commit 0d0a5ed

Browse files
Trottevanlucas
authored andcommitted
debugger: remove variable redeclarations
Some variables are declared with var more than once in the same scope. This change reduces the declarations to one per scope. PR-URL: #4633 Reviewed-By: jasnell - James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 8bf5b33 commit 0d0a5ed

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/_debugger.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ Client.prototype.setBreakpoint = function(req, cb) {
462462
};
463463

464464
Client.prototype.clearBreakpoint = function(req, cb) {
465-
var req = {
465+
req = {
466466
command: 'clearbreakpoint',
467467
arguments: req
468468
};
@@ -1352,9 +1352,10 @@ Interface.prototype.setBreakpoint = function(script, line,
13521352
return;
13531353
}
13541354

1355+
let req;
13551356
if (/\(\)$/.test(script)) {
13561357
// setBreakpoint('functionname()');
1357-
var req = {
1358+
req = {
13581359
type: 'function',
13591360
target: script.replace(/\(\)$/, ''),
13601361
condition: condition
@@ -1380,7 +1381,6 @@ Interface.prototype.setBreakpoint = function(script, line,
13801381
if (ambiguous) return this.error('Script name is ambiguous');
13811382
if (line <= 0) return this.error('Line should be a positive value');
13821383

1383-
var req;
13841384
if (scriptId) {
13851385
req = {
13861386
type: 'scriptId',
@@ -1651,7 +1651,7 @@ Interface.prototype.trySpawn = function(cb) {
16511651

16521652
var isRemote = false;
16531653
if (this.args.length === 2) {
1654-
var match = this.args[1].match(/^([^:]+):(\d+)$/);
1654+
const match = this.args[1].match(/^([^:]+):(\d+)$/);
16551655

16561656
if (match) {
16571657
// Connecting to remote debugger
@@ -1675,7 +1675,7 @@ Interface.prototype.trySpawn = function(cb) {
16751675
}
16761676
isRemote = true;
16771677
} else {
1678-
var match = this.args[1].match(/^--port=(\d+)$/);
1678+
const match = this.args[1].match(/^--port=(\d+)$/);
16791679
if (match) {
16801680
// Start debugger on custom port
16811681
// `node debug --port=5858 app.js`

0 commit comments

Comments
 (0)