Skip to content

Commit 66b9c0d

Browse files
committed
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 <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 19f7008 commit 66b9c0d

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
@@ -463,7 +463,7 @@ Client.prototype.setBreakpoint = function(req, cb) {
463463
};
464464

465465
Client.prototype.clearBreakpoint = function(req, cb) {
466-
var req = {
466+
req = {
467467
command: 'clearbreakpoint',
468468
arguments: req
469469
};
@@ -1353,9 +1353,10 @@ Interface.prototype.setBreakpoint = function(script, line,
13531353
return;
13541354
}
13551355

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

1384-
var req;
13851385
if (scriptId) {
13861386
req = {
13871387
type: 'scriptId',
@@ -1652,7 +1652,7 @@ Interface.prototype.trySpawn = function(cb) {
16521652

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

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

0 commit comments

Comments
 (0)