mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 22:19:49 +00:00
Use int.tryParse in sourcemap_testing
Change-Id: I7e2f51628604cc7522752b7b67d3c5b6775901c2 Reviewed-on: https://dart-review.googlesource.com/54905 Reviewed-by: Jens Johansen <jensj@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
parent
37d028e17c
commit
e7bae4c8fd
|
@ -285,14 +285,12 @@ class StackTraceLine {
|
|||
String fileName;
|
||||
int lastColon = text.lastIndexOf(':');
|
||||
if (lastColon != -1) {
|
||||
int lastValue =
|
||||
int.parse(text.substring(lastColon + 1), onError: (_) => null);
|
||||
int lastValue = int.tryParse(text.substring(lastColon + 1));
|
||||
if (lastValue != null) {
|
||||
int secondToLastColon = text.lastIndexOf(':', lastColon - 1);
|
||||
if (secondToLastColon != -1) {
|
||||
int secondToLastValue = int.parse(
|
||||
text.substring(secondToLastColon + 1, lastColon),
|
||||
onError: (_) => null);
|
||||
int secondToLastValue =
|
||||
int.tryParse(text.substring(secondToLastColon + 1, lastColon));
|
||||
if (secondToLastValue != null) {
|
||||
lineNo = secondToLastValue;
|
||||
columnNo = lastValue;
|
||||
|
|
Loading…
Reference in a new issue