diff options
author | Rich Trott <rtrott@gmail.com> | 2016-01-11 15:38:38 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-01-15 21:55:27 -0800 |
commit | 66b9c0d8bdb7f9fb542f53c2c18bacd5bbca272d (patch) | |
tree | a61a6f854337f69506a132c4a97caa8c399ee5f4 /lib | |
parent | 19f700859b55b96c7ed9bdeb68482c6a9d84e1b2 (diff) | |
download | node-new-66b9c0d8bdb7f9fb542f53c2c18bacd5bbca272d.tar.gz |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_debugger.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/_debugger.js b/lib/_debugger.js index 2bab958418..26f545c535 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -463,7 +463,7 @@ Client.prototype.setBreakpoint = function(req, cb) { }; Client.prototype.clearBreakpoint = function(req, cb) { - var req = { + req = { command: 'clearbreakpoint', arguments: req }; @@ -1353,9 +1353,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 @@ -1381,7 +1382,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', @@ -1652,7 +1652,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 @@ -1676,7 +1676,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` |