Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
debugger: remove variable redeclarations
  • Loading branch information
Trott committed Jan 13, 2016
commit 987c79e9af73767fd80eff4a49f1496c78bf3719
11 changes: 6 additions & 5 deletions lib/_debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ Client.prototype.setBreakpoint = function(req, cb) {
};

Client.prototype.clearBreakpoint = function(req, cb) {
var req = {
req = {
command: 'clearbreakpoint',
arguments: req
};
Expand Down Expand Up @@ -1353,9 +1353,10 @@ Interface.prototype.setBreakpoint = function(script, line,
return;
}

var req;
if (/\(\)$/.test(script)) {
// setBreakpoint('functionname()');
var req = {
req = {
type: 'function',
target: script.replace(/\(\)$/, ''),
condition: condition
Expand All @@ -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',
Expand Down Expand Up @@ -1653,8 +1653,9 @@ Interface.prototype.trySpawn = function(cb) {
assert(!this.child);

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

if (match) {
// Connecting to remote debugger
Expand All @@ -1678,7 +1679,7 @@ Interface.prototype.trySpawn = function(cb) {
}
isRemote = true;
} else {
var match = this.args[1].match(/^--port=(\d+)$/);
match = this.args[1].match(/^--port=(\d+)$/);
if (match) {
// Start debugger on custom port
// `node debug --port=5858 app.js`
Expand Down