Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(822)

Unified Diff: packages/package_config/lib/discovery_analysis.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/package_config/lib/discovery.dart ('k') | packages/package_config/lib/packages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/package_config/lib/discovery_analysis.dart
diff --git a/packages/package_config/lib/discovery_analysis.dart b/packages/package_config/lib/discovery_analysis.dart
index af4df070a4ac7b471caf26b8023fb527afeedf02..058330b194c97d0a922f4e224a82246ba58237f0 100644
--- a/packages/package_config/lib/discovery_analysis.dart
+++ b/packages/package_config/lib/discovery_analysis.dart
@@ -41,7 +41,7 @@ abstract class PackageContext {
/// Look up the [PackageContext] that applies to a specific directory.
///
/// The directory must be inside [directory].
- PackageContext operator[](Directory directory);
+ PackageContext operator [](Directory directory);
/// A map from directory to package resolver.
///
@@ -57,14 +57,14 @@ abstract class PackageContext {
/// directory of `directory`. If there is, its corresponding `Packages` object
/// should be provided as `root`.
static PackageContext findAll(Directory directory,
- {Packages root: Packages.noPackages}) {
+ {Packages root: Packages.noPackages}) {
if (!directory.existsSync()) {
throw new ArgumentError("Directory not found: $directory");
}
- List contexts = [];
+ var contexts = <PackageContext>[];
void findRoots(Directory directory) {
Packages packages;
- List oldContexts;
+ List<PackageContext> oldContexts;
File packagesFile = new File(path.join(directory.path, ".packages"));
if (packagesFile.existsSync()) {
packages = _loadPackagesFile(packagesFile);
@@ -93,8 +93,7 @@ abstract class PackageContext {
}
findRoots(directory);
// If the root is not itself context root, add a the wrapper context.
- if (contexts.length == 1 &&
- contexts[0].directory == directory) {
+ if (contexts.length == 1 && contexts[0].directory == directory) {
return contexts[0];
}
return new _PackageContext(directory, root, contexts);
@@ -120,7 +119,7 @@ class _PackageContext implements PackageContext {
return result;
}
- PackageContext operator[](Directory directory) {
+ PackageContext operator [](Directory directory) {
String path = directory.path;
if (!path.startsWith(this.directory.path)) {
throw new ArgumentError("Not inside $path: $directory");
« no previous file with comments | « packages/package_config/lib/discovery.dart ('k') | packages/package_config/lib/packages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698