mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:27:17 +00:00
Don't crash on error at end-of-file.
BUG= Review URL: https://codereview.chromium.org/1415883011.
This commit is contained in:
parent
c0d5f73bd0
commit
d4021e92a1
|
@ -137,6 +137,11 @@ abstract class SourceFile implements LineColumnProvider {
|
|||
if (colorize == null) {
|
||||
colorize = (text) => text;
|
||||
}
|
||||
if (end > length) {
|
||||
start = length - 1;
|
||||
end = length;
|
||||
}
|
||||
|
||||
int lineStart = getLine(start);
|
||||
int columnStart = getColumn(lineStart, start);
|
||||
int lineEnd = getLine(end);
|
||||
|
|
Loading…
Reference in a new issue