mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 08:24:39 +00:00
Revert "Clean up the use of deprecated API in the analyzer_plugin package"
This reverts commit 86ba29265a
.
The replacement API (int.tryParse) has only just been introduced and
is not yet avaiable to internal Google users. I plan to un-do the
commit in about a week once the internal SDK has been updated.
Change-Id: Ic9206231861400d42f4814e4a56bde57ba8705a5
Reviewed-on: https://dart-review.googlesource.com/52822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
parent
f95df2a26b
commit
115850ca1d
|
@ -277,11 +277,9 @@ abstract class JsonDecoder {
|
|||
if (json is int) {
|
||||
return json;
|
||||
} else if (json is String) {
|
||||
int value = int.tryParse(json);
|
||||
if (value == null) {
|
||||
return int.parse(json, onError: (String value) {
|
||||
throw mismatch(jsonPath, 'int', json);
|
||||
}
|
||||
return value;
|
||||
});
|
||||
}
|
||||
throw mismatch(jsonPath, 'int', json);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue