mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
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: https://github.com/nodejs/node/pull/4633 Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
7821b3e305
commit
583f3347d8
1 file changed
+5
-5
+5
-5
@@ -462,7 +462,7 @@ Client.prototype.setBreakpoint = function(req, cb) {
|
||||
};
|
||||
|
||||
Client.prototype.clearBreakpoint = function(req, cb) {
|
||||
var req = {
|
||||
req = {
|
||||
command: 'clearbreakpoint',
|
||||
arguments: req
|
||||
};
|
||||
@@ -1345,9 +1345,10 @@ Interface.prototype.setBreakpoint = function(script, line,
|
||||
return;
|
||||
}
|
||||
|
||||
let req;
|
||||
if (/\(\)$/.test(script)) {
|
||||
// setBreakpoint('functionname()');
|
||||
var req = {
|
||||
req = {
|
||||
type: 'function',
|
||||
target: script.replace(/\(\)$/, ''),
|
||||
condition: condition
|
||||
@@ -1373,7 +1374,6 @@ Interface.prototype.setBreakpoint = function(script, line,
|
||||
if (ambiguous) return this.error('Script name is ambiguous');
|
||||
if (line <= 0) return this.error('Line should be a positive value');
|
||||
|
||||
var req;
|
||||
if (scriptId) {
|
||||
req = {
|
||||
type: 'scriptId',
|
||||
@@ -1630,7 +1630,7 @@ Interface.prototype.trySpawn = function(cb) {
|
||||
|
||||
var isRemote = false;
|
||||
if (this.args.length === 2) {
|
||||
var match = this.args[1].match(/^([^:]+):(\d+)$/);
|
||||
const match = this.args[1].match(/^([^:]+):(\d+)$/);
|
||||
|
||||
if (match) {
|
||||
// Connecting to remote debugger
|
||||
@@ -1654,7 +1654,7 @@ Interface.prototype.trySpawn = function(cb) {
|
||||
}
|
||||
isRemote = true;
|
||||
} else {
|
||||
var match = this.args[1].match(/^--port=(\d+)$/);
|
||||
const match = this.args[1].match(/^--port=(\d+)$/);
|
||||
if (match) {
|
||||
// Start debugger on custom port
|
||||
// `node debug --port=5858 app.js`
|
||||
|
||||
Reference in new issue
Block a user