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

Unified Diff: utils/pub/version.dart

Issue 10989013: Change IllegalArgumentException to ArgumentError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated co19 test expectations. Created 8 years, 3 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: utils/pub/version.dart
diff --git a/utils/pub/version.dart b/utils/pub/version.dart
index bc1dda663b40c1c081700ef3c777709848c79eee..a917f23c105f6572d90233ad4dabaa22753e3421 100644
--- a/utils/pub/version.dart
+++ b/utils/pub/version.dart
@@ -43,11 +43,11 @@ class Version implements Comparable, Hashable, VersionConstraint {
/** Creates a new [Version] object. */
Version(this.major, this.minor, this.patch, [String pre, this.build])
: preRelease = pre {
- if (major < 0) throw new IllegalArgumentException(
+ if (major < 0) throw new ArgumentError(
'Major version must be non-negative.');
- if (minor < 0) throw new IllegalArgumentException(
+ if (minor < 0) throw new ArgumentError(
'Minor version must be non-negative.');
- if (patch < 0) throw new IllegalArgumentException(
+ if (patch < 0) throw new ArgumentError(
'Patch version must be non-negative.');
}
@@ -98,7 +98,7 @@ class Version implements Comparable, Hashable, VersionConstraint {
// Intersecting two versions only works if they are the same.
if (other is Version) return this == other ? this : const _EmptyVersion();
- throw new IllegalArgumentException(
+ throw new ArgumentError(
'Unknown VersionConstraint type $other.');
}
@@ -260,7 +260,7 @@ class VersionRange implements VersionConstraint {
VersionRange([this.min, this.max,
this.includeMin = false, this.includeMax = false]) {
if (min != null && max != null && min > max) {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
'Minimum version ("$min") must be less than maximum ("$max").');
}
}
@@ -343,7 +343,7 @@ class VersionRange implements VersionConstraint {
intersectIncludeMin, intersectIncludeMax);
}
- throw new IllegalArgumentException(
+ throw new ArgumentError(
'Unknown VersionConstraint type $other.');
}

Powered by Google App Engine
This is Rietveld 408576698