214cdbdc81
Previously it tested if it was at the end of file (defined as _currentLine >= _lines.length), if it was not it would try to read the _next_ line (_peek(1)), meaning that if _currentLine = _lines.length - 1 it would _peek(1) and try to read _lines[lines.length] and crash with a range error. This CL fixes it by actually checking if it can safely peek the amount it wants to. Change-Id: I2e66c539e823f0b39bd0da39e2b2277a9e6c9501 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150624 Commit-Queue: Bob Nystrom <rnystrom@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com>