mirror of https://github.com/nodejs/node.git
debugger: style
parent
9244a64b59
commit
109f845e49
|
@ -357,17 +357,15 @@ Client.prototype.step = function(action, count, cb) {
|
|||
|
||||
var helpMessage = "Commands: run, print, step, next, continue, scripts, backtrace, version, quit";
|
||||
|
||||
function SourceUnderline(source_text, position) {
|
||||
if (!source_text) {
|
||||
return;
|
||||
}
|
||||
function SourceUnderline(sourceText, position) {
|
||||
if (!sourceText) return;
|
||||
|
||||
// Create an underline with a caret pointing to the source position. If the
|
||||
// source contains a tab character the underline will have a tab character in
|
||||
// the same place otherwise the underline will have a space character.
|
||||
var underline = '';
|
||||
for (var i = 0; i < position; i++) {
|
||||
if (source_text[i] == '\t') {
|
||||
if (sourceText[i] == '\t') {
|
||||
underline += '\t';
|
||||
} else {
|
||||
underline += ' ';
|
||||
|
@ -376,7 +374,7 @@ function SourceUnderline(source_text, position) {
|
|||
underline += '^';
|
||||
|
||||
// Return the source line text with the underline beneath.
|
||||
return source_text + '\n' + underline;
|
||||
return sourceText + '\n' + underline;
|
||||
}
|
||||
|
||||
function SourceInfo(body) {
|
||||
|
@ -389,10 +387,8 @@ function SourceInfo(body) {
|
|||
result += '[unnamed]';
|
||||
}
|
||||
}
|
||||
result += ' line ';
|
||||
result += ':';
|
||||
result += body.sourceLine + 1;
|
||||
result += ' column ';
|
||||
result += body.sourceColumn + 1;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue