Roll engine to 76cb311d9c33720dcd19274228b39ecdbad8d9af (with rolled dart) (#16518)

* Handle error count reported by frontend.

Extend compilation result from single string to a structure(string filename and integer error count).

* Use ?.

* Include engine roll with dart sdk roll.

* parse(onError) -> tryParse

* Make '?? throw' more readable and avoid issue with analyzer

* Fix test so it mocks compiler output including errors count
This commit is contained in:
Alexander Aprelev
2018-04-12 16:28:01 -07:00
committed by Siva
parent c73b8a7cf6
commit e0cd42e4ad
13 changed files with 75 additions and 48 deletions

View File

@@ -210,7 +210,7 @@ class AndroidDevice extends Device {
// Sample output: '22'
final String sdkVersion = await _getProperty('ro.build.version.sdk');
final int sdkVersionParsed = int.parse(sdkVersion, onError: (String source) => null);
final int sdkVersionParsed = int.tryParse(sdkVersion);
if (sdkVersionParsed == null) {
printError('Unexpected response from getprop: "$sdkVersion"');
return false;
@@ -817,7 +817,7 @@ class _AndroidDevicePortForwarder extends DevicePortForwarder {
final AndroidDevice device;
static int _extractPort(String portString) {
return int.parse(portString.trim(), onError: (_) => null);
return int.tryParse(portString.trim());
}
@override