Commit 33ef949e authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Declare locals as final where not reassigned (#8576)

Fix a few regressions.
parent cdeb83cf
...@@ -19,7 +19,7 @@ class _PlatformServicesState extends State<PlatformServices> { ...@@ -19,7 +19,7 @@ class _PlatformServicesState extends State<PlatformServices> {
Future<Null> _getLocation() async { Future<Null> _getLocation() async {
String location; String location;
try { try {
List<double> result = await platform.invokeMethod('getLocation', 'network'); final List<double> result = await platform.invokeMethod('getLocation', 'network');
location = 'Latitude ${result[0]}, Longitude ${result[1]}.'; location = 'Latitude ${result[0]}, Longitude ${result[1]}.';
} on PlatformException catch (e) { } on PlatformException catch (e) {
location = "Failed to get location: '${e.message}'."; location = "Failed to get location: '${e.message}'.";
......
...@@ -145,11 +145,11 @@ void main() { ...@@ -145,11 +145,11 @@ void main() {
expect(bytes, 69); expect(bytes, 69);
}); });
testUsingContext('add new package with double slashes in URI', () async { testUsingContext('add new package with double slashes in URI', () async {
String packageName = 'doubleslashpkg'; final String packageName = 'doubleslashpkg';
await _createPackage(packageName, 'somefile.txt', doubleSlash: true); await _createPackage(packageName, 'somefile.txt', doubleSlash: true);
Set<String> fileFilter = new Set<String>(); final Set<String> fileFilter = new Set<String>();
List<Uri> pkgUris = <Uri>[fs.path.toUri(basePath)]..addAll(_packages.values); final List<Uri> pkgUris = <Uri>[fs.path.toUri(basePath)]..addAll(_packages.values);
for (Uri pkgUri in pkgUris) { for (Uri pkgUri in pkgUris) {
if (!pkgUri.isAbsolute) { if (!pkgUri.isAbsolute) {
pkgUri = fs.path.toUri(fs.path.join(basePath, pkgUri.path)); pkgUri = fs.path.toUri(fs.path.join(basePath, pkgUri.path));
...@@ -161,7 +161,7 @@ void main() { ...@@ -161,7 +161,7 @@ void main() {
.toList()); .toList());
} }
int bytes = await devFS.update(fileFilter: fileFilter); final int bytes = await devFS.update(fileFilter: fileFilter);
devFSOperations.expectMessages(<String>[ devFSOperations.expectMessages(<String>[
'writeFile test .packages', 'writeFile test .packages',
'writeFile test packages/doubleslashpkg/somefile.txt', 'writeFile test packages/doubleslashpkg/somefile.txt',
...@@ -364,7 +364,7 @@ Future<Null> _createPackage(String pkgName, String pkgFileName, { bool doubleSla ...@@ -364,7 +364,7 @@ Future<Null> _createPackage(String pkgName, String pkgFileName, { bool doubleSla
String pkgFilePath = fs.path.join(pkgTempDir.path, pkgName, 'lib', pkgFileName); String pkgFilePath = fs.path.join(pkgTempDir.path, pkgName, 'lib', pkgFileName);
if (doubleSlash) { if (doubleSlash) {
// Force two separators into the path. // Force two separators into the path.
String doubleSlash = fs.path.separator + fs.path.separator; final String doubleSlash = fs.path.separator + fs.path.separator;
pkgFilePath = pkgTempDir.path + doubleSlash + fs.path.join(pkgName, 'lib', pkgFileName); pkgFilePath = pkgTempDir.path + doubleSlash + fs.path.join(pkgName, 'lib', pkgFileName);
} }
final File pkgFile = fs.file(pkgFilePath); final File pkgFile = fs.file(pkgFilePath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment