mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
Use 1-based line numbers instead of 0-based line numbers in nodes toString().
This commit is contained in:
@@ -122,16 +122,19 @@
|
||||
};
|
||||
|
||||
Base.prototype.toString = function(idt, name) {
|
||||
var firstLine, lastLine, location, tree, _ref2, _ref3;
|
||||
var firstLine, lastLine, location, tree;
|
||||
if (idt == null) {
|
||||
idt = '';
|
||||
}
|
||||
if (name == null) {
|
||||
name = this.constructor.name;
|
||||
}
|
||||
firstLine = ((_ref2 = this.locationData) != null ? _ref2.first_line : void 0) || "unknown";
|
||||
lastLine = ((_ref3 = this.locationData) != null ? _ref3.last_line : void 0) || "unknown";
|
||||
location = firstLine + (lastLine !== firstLine ? "-" + lastLine : "") + ": ";
|
||||
location = "";
|
||||
if (this.locationData) {
|
||||
firstLine = this.locationData.first_line + 1;
|
||||
lastLine = this.locationData.last_line + 1;
|
||||
location = firstLine + (lastLine !== firstLine ? "-" + lastLine : "") + ": ";
|
||||
}
|
||||
tree = '\n' + idt + location + name;
|
||||
if (this.soak) {
|
||||
tree += '?';
|
||||
|
||||
Reference in New Issue
Block a user