Skip to content

Commit 583f334

Browse files
TrottMyles Borins
authored and
Myles Borins
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 7821b3e commit 583f334

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/_debugger.js

+5-5
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
};
@@ -1345,9 +1345,10 @@ Interface.prototype.setBreakpoint = function(script, line,
13451345
return;
13461346
}
13471347

1348+
let req;
13481349
if (/\(\)$/.test(script)) {
13491350
// setBreakpoint('functionname()');
1350-
var req = {
1351+
req = {
13511352
type: 'function',
13521353
target: script.replace(/\(\)$/, ''),
13531354
condition: condition
@@ -1373,7 +1374,6 @@ Interface.prototype.setBreakpoint = function(script, line,
13731374
if (ambiguous) return this.error('Script name is ambiguous');
13741375
if (line <= 0) return this.error('Line should be a positive value');
13751376

1376-
var req;
13771377
if (scriptId) {
13781378
req = {
13791379
type: 'scriptId',
@@ -1630,7 +1630,7 @@ Interface.prototype.trySpawn = function(cb) {
16301630

16311631
var isRemote = false;
16321632
if (this.args.length === 2) {
1633-
var match = this.args[1].match(/^([^:]+):(\d+)$/);
1633+
const match = this.args[1].match(/^([^:]+):(\d+)$/);
16341634

16351635
if (match) {
16361636
// Connecting to remote debugger
@@ -1654,7 +1654,7 @@ Interface.prototype.trySpawn = function(cb) {
16541654
}
16551655
isRemote = true;
16561656
} else {
1657-
var match = this.args[1].match(/^--port=(\d+)$/);
1657+
const match = this.args[1].match(/^--port=(\d+)$/);
16581658
if (match) {
16591659
// Start debugger on custom port
16601660
// `node debug --port=5858 app.js`

0 commit comments

Comments
 (0)