mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:09:49 +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) {
|
if (json is int) {
|
||||||
return json;
|
return json;
|
||||||
} else if (json is String) {
|
} else if (json is String) {
|
||||||
int value = int.tryParse(json);
|
return int.parse(json, onError: (String value) {
|
||||||
if (value == null) {
|
|
||||||
throw mismatch(jsonPath, 'int', json);
|
throw mismatch(jsonPath, 'int', json);
|
||||||
}
|
});
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
throw mismatch(jsonPath, 'int', json);
|
throw mismatch(jsonPath, 'int', json);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue