setBreakpoint w/o arguments should set one on a current line

pull/22966/head
Fedor Indutny 2011-09-15 22:21:04 +07:00 committed by Ryan Dahl
parent 4a537c1b88
commit 145fac7fb1
1 changed files with 6 additions and 0 deletions

View File

@ -1110,6 +1110,12 @@ Interface.prototype.setBreakpoint = function(script, line,
scriptId,
ambiguous;
// setBreakpoint() should insert breakpoint on current line
if (script === undefined) {
script = this.client.currentScript;
line = this.client.currentSourceLine + 1;
}
if (script != +script && !this.client.scripts[script]) {
Object.keys(this.client.scripts).forEach(function(id) {
if (self.client.scripts[id].name.indexOf(script) !== -1) {