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

Unified Diff: lib/uri/uri.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: lib/uri/uri.dart
diff --git a/lib/uri/uri.dart b/lib/uri/uri.dart
index d087320b18d289e8feb4fa81863a46024a4aeee1..7a2446b013c294e80683fbfb173193484ee50f54 100644
--- a/lib/uri/uri.dart
+++ b/lib/uri/uri.dart
@@ -181,17 +181,17 @@ class Uri {
/**
* For http/https schemes returns URI's [origin][] - scheme://domain:port.
- * For all other schemes throws IllegalArgumentException.
+ * For all other schemes throws ArgumentError.
* [origin]: http://www.w3.org/TR/2011/WD-html5-20110405/origin-0.html#origin
*/
String get origin {
if (scheme == "") {
// TODO(aprelev@gmail.com): Use StateException instead
- throw new IllegalArgumentException("Cannot use origin without a scheme");
+ throw new ArgumentError("Cannot use origin without a scheme");
}
if (scheme != "http" && scheme != "https") {
// TODO(aprelev@gmail.com): Use StateException instead
- throw new IllegalArgumentException(
+ throw new ArgumentError(
"origin is applicable to http/https schemes only. Not \'$scheme\'");
}
StringBuffer sb = new StringBuffer();
@@ -199,7 +199,7 @@ class Uri {
sb.add(":");
if (domain == null || domain == "") {
// TODO(aprelev@gmail.com): Use StateException instead
- throw new IllegalArgumentException("Cannot use origin without a domain");
+ throw new ArgumentError("Cannot use origin without a domain");
}
sb.add("//");

Powered by Google App Engine
This is Rietveld 408576698