mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
Clean up the use of deprecated API in the analyzer_plugin package
Change-Id: If63afeea8042814fd87a109aa40a6ed14ea7ee59 Reviewed-on: https://dart-review.googlesource.com/51102 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
fbb60b786f
commit
86ba29265a
|
@ -277,9 +277,11 @@ abstract class JsonDecoder {
|
|||
if (json is int) {
|
||||
return json;
|
||||
} else if (json is String) {
|
||||
return int.parse(json, onError: (String value) {
|
||||
int value = int.tryParse(json);
|
||||
if (value == null) {
|
||||
throw mismatch(jsonPath, 'int', json);
|
||||
});
|
||||
}
|
||||
return value;
|
||||
}
|
||||
throw mismatch(jsonPath, 'int', json);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue