Wire assertions to global abort, see #8

This commit is contained in:
dcodeIO
2018-01-27 16:23:00 +01:00
parent de066fc128
commit 5d76ba9437
6 changed files with 161 additions and 66 deletions

View File

@ -121,20 +121,12 @@ export function formatDiagnosticMessage(message: DiagnosticMessage, useColors: b
sb.push(context);
}
sb.push("\n");
var pos = range.start;
var line = 1;
var column = 1;
while (pos-- > 0)
if (text.charCodeAt(pos) == CharCode.LINEFEED)
line++;
else if (line == 1)
column++;
sb.push(" in ");
sb.push(range.source.path);
sb.push("(");
sb.push(line.toString(10));
sb.push(range.line.toString(10));
sb.push(",");
sb.push(column.toString(10));
sb.push(range.column.toString(10));
sb.push(")");
}
return sb.join("");