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

Unified Diff: lib/src/version_constraint.dart

Issue 2045803002: Add VersionConstraint.difference(). (Closed) Base URL: git@github.com:dart-lang/pub_semver@master
Patch Set: 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
Index: lib/src/version_constraint.dart
diff --git a/lib/src/version_constraint.dart b/lib/src/version_constraint.dart
index 68827a40c4c9084336df94f3cc7bac4f973a1678..147a732d530b3629876fb1d94b9cb6033d76414a 100644
--- a/lib/src/version_constraint.dart
+++ b/lib/src/version_constraint.dart
@@ -236,6 +236,10 @@ abstract class VersionConstraint {
/// Creates a new [VersionConstraint] that allows [Versions]s allowed by
/// either this or [other].
VersionConstraint union(VersionConstraint other);
+
+ /// Creates a new [VersionConstraint] that allows [Version]s allowed by this
Bob Nystrom 2016/06/08 22:51:06 Technically, these don't always create *new* const
nweiz 2016/06/08 23:39:02 Done.
+ /// but not [other].
+ VersionConstraint difference(VersionConstraint other);
}
class _EmptyVersion implements VersionConstraint {
@@ -248,6 +252,7 @@ class _EmptyVersion implements VersionConstraint {
bool allowsAny(VersionConstraint other) => false;
VersionConstraint intersect(VersionConstraint other) => this;
VersionConstraint union(VersionConstraint other) => other;
+ VersionConstraint difference(VersionConstraint other) => this;
String toString() => '<empty>';
}
« lib/src/utils.dart ('K') | « lib/src/version.dart ('k') | lib/src/version_range.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698