| Index: utils/pub/version.dart
|
| diff --git a/utils/pub/version.dart b/utils/pub/version.dart
|
| index 061c31951215d568166f189454f6b33b2192c04b..c7b0d1d45f342edf0bd3aa04bfd136c44be3125b 100644
|
| --- a/utils/pub/version.dart
|
| +++ b/utils/pub/version.dart
|
| @@ -9,8 +9,12 @@
|
| */
|
| #library('pub_version');
|
|
|
| +#import('utils.dart');
|
| +
|
| /** A parsed semantic version number. */
|
| -class Version implements Comparable, VersionConstraint {
|
| +class Version implements Comparable, Hashable, VersionConstraint {
|
| + static get none() => new Version(0, 0, 0);
|
| +
|
| static final _PARSE_REGEX = const RegExp(
|
| @'^' // Start at beginning.
|
| @'(\d+).(\d+).(\d+)' // Version number.
|
| @@ -104,6 +108,8 @@ class Version implements Comparable, VersionConstraint {
|
| return 0;
|
| }
|
|
|
| + int hashCode() => toString().hashCode();
|
| +
|
| String toString() {
|
| var buffer = new StringBuffer();
|
| buffer.add('$major.$minor.$patch');
|
| @@ -201,12 +207,3 @@ class VersionRange implements VersionConstraint {
|
| return true;
|
| }
|
| }
|
| -
|
| -/** Thrown by [Version.parse()] if the argument isn't a valid version string. */
|
| -class FormatException implements Exception {
|
| - final String message;
|
| -
|
| - FormatException(this.message);
|
| -
|
| - String toString() => message;
|
| -}
|
|
|