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

Unified Diff: lib/src/package_graph.dart

Issue 2044253003: Refactor Source and SourceRegistry. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Rename LiveSource to BoundSource. Created 4 years, 6 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 | « lib/src/lock_file.dart ('k') | lib/src/solver/backtracking_solver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/package_graph.dart
diff --git a/lib/src/package_graph.dart b/lib/src/package_graph.dart
index ae603ed2e388ed3e26bb264df2f8ff38ba0252dd..f6b4a9317811de7fb20dca417a4c4f0bd3c55ef0 100644
--- a/lib/src/package_graph.dart
+++ b/lib/src/package_graph.dart
@@ -48,7 +48,7 @@ class PackageGraph {
if (id.name == entrypoint.root.name) return entrypoint.root;
return new Package(result.pubspecs[id.name],
- entrypoint.cache.sources[id.source].getDirectory(id));
+ entrypoint.cache.source(id.source).getDirectory(id));
});
return new PackageGraph(entrypoint, result.lockFile, packages);
@@ -125,8 +125,7 @@ class PackageGraph {
var id = lockFile.packages[package];
if (id == null) return true;
- var source = entrypoint.cache.sources[id.source];
- if (source is! CachedSource) return true;
+ if (entrypoint.cache.source(id.source) is! CachedSource) return true;
return transitiveDependencies(package).any((dep) {
var depId = lockFile.packages[dep.name];
@@ -135,7 +134,7 @@ class PackageGraph {
// mutable.
if (depId == null) return true;
- return entrypoint.cache.sources[depId.source] is! CachedSource;
+ return entrypoint.cache.source(depId.source) is! CachedSource;
});
}
@@ -150,10 +149,7 @@ class PackageGraph {
bool isPackageStatic(String package) {
var id = lockFile.packages[package];
if (id == null) return false;
-
- var source = entrypoint.cache.sources[id.source];
- if (source is! CachedSource) return false;
-
+ if (entrypoint.cache.source(id.source) is! CachedSource) return false;
return packages[package].pubspec.transformers.isEmpty;
}
}
« no previous file with comments | « lib/src/lock_file.dart ('k') | lib/src/solver/backtracking_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698