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 583f334

Browse filesBrowse files
TrottMyles Borins
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 <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7821b3e commit 583f334
Copy full SHA for 583f334

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎lib/_debugger.js‎

Copy file name to clipboardExpand all lines: lib/_debugger.js
+5-5Lines 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
};
@@ -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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.