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> {
Future<Null> _getLocation() async {
String location;
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]}.';
} on PlatformException catch (e) {
location = "Failed to get location: '${e.message}'.";
......
......@@ -145,11 +145,11 @@ void main() {
expect(bytes, 69);
});
testUsingContext('add new package with double slashes in URI', () async {
String packageName = 'doubleslashpkg';
final String packageName = 'doubleslashpkg';
await _createPackage(packageName, 'somefile.txt', doubleSlash: true);
Set<String> fileFilter = new Set<String>();
List<Uri> pkgUris = <Uri>[fs.path.toUri(basePath)]..addAll(_packages.values);
final Set<String> fileFilter = new Set<String>();
final List<Uri> pkgUris = <Uri>[fs.path.toUri(basePath)]..addAll(_packages.values);
for (Uri pkgUri in pkgUris) {
if (!pkgUri.isAbsolute) {
pkgUri = fs.path.toUri(fs.path.join(basePath, pkgUri.path));
......@@ -161,7 +161,7 @@ void main() {
.toList());
}
int bytes = await devFS.update(fileFilter: fileFilter);
final int bytes = await devFS.update(fileFilter: fileFilter);
devFSOperations.expectMessages(<String>[
'writeFile test .packages',
'writeFile test packages/doubleslashpkg/somefile.txt',
......@@ -364,7 +364,7 @@ Future<Null> _createPackage(String pkgName, String pkgFileName, { bool doubleSla
String pkgFilePath = fs.path.join(pkgTempDir.path, pkgName, 'lib', pkgFileName);
if (doubleSlash) {
// 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);
}
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