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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user