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

Unified Diff: sdk/lib/_internal/pub/lib/src/solver/version_selection.dart

Issue 1130263003: Fix VersionSelection.getDependenciesOn. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/solver/version_selection.dart
diff --git a/sdk/lib/_internal/pub/lib/src/solver/version_selection.dart b/sdk/lib/_internal/pub/lib/src/solver/version_selection.dart
index 2f5f30e41444bcc3c66ad32dd9c647313ea35147..cabf450951536cdf748d34f124d1054d4761f855 100644
--- a/sdk/lib/_internal/pub/lib/src/solver/version_selection.dart
+++ b/sdk/lib/_internal/pub/lib/src/solver/version_selection.dart
@@ -61,7 +61,7 @@ class VersionSelection {
// Add all of [id]'s dependencies to [_dependencies], as well as to
// [_unselected] if necessary.
await Future.forEach(await _solver.depsFor(id), (dep) async {
- var deps = getDependencies(dep.name);
+ var deps = getDependenciesOn(dep.name);
deps.add(new Dependency(id, dep));
// If this is the first dependency on this package, add it to the
@@ -84,7 +84,7 @@ class VersionSelection {
await _unselected.add(id.toRef());
for (var dep in await _solver.depsFor(id)) {
- var deps = getDependencies(dep.name);
+ var deps = getDependenciesOn(dep.name);
deps.removeLast();
if (deps.isEmpty) {
@@ -116,13 +116,13 @@ class VersionSelection {
/// can have a bunch of dependencies back onto the root package as long as
/// they all agree with each other.
Dependency getRequiredDependency(String name) {
- return getDependencies(name)
+ return getDependenciesOn(name)
.firstWhere((dep) => !dep.dep.isRoot, orElse: () => null);
}
/// Gets the combined [VersionConstraint] currently placed on package [name].
VersionConstraint getConstraint(String name) {
- var constraint = getDependencies(name)
+ var constraint = getDependenciesOn(name)
.map((dep) => dep.dep.constraint)
.fold(VersionConstraint.any, (a, b) => a.intersect(b));
@@ -135,11 +135,11 @@ class VersionSelection {
/// Returns a string description of the dependencies on [name].
String describeDependencies(String name) =>
- getDependencies(name).map((dep) => " $dep").join('\n');
+ getDependenciesOn(name).map((dep) => " $dep").join('\n');
/// Gets the list of known dependencies on package [name].
///
/// Creates an empty list if needed.
- List<Dependency> getDependencies(String name) =>
+ List<Dependency> getDependenciesOn(String name) =>
_dependencies.putIfAbsent(name, () => <Dependency>[]);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698