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

Unified Diff: lib/utf/utf_core.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/utf/utf_core.dart
diff --git a/lib/utf/utf_core.dart b/lib/utf/utf_core.dart
index 9034c507c4b931c72ddbf186a83a38c2a885b65c..32f3f847960f156b6b43c8ca7408e87d028fc23c 100644
--- a/lib/utf/utf_core.dart
+++ b/lib/utf/utf_core.dart
@@ -106,7 +106,7 @@ List<int> _codepointsToUtf16CodeUnits(
} else if (replacementCodepoint != null) {
codeUnitsBuffer[j++] = replacementCodepoint;
} else {
- throw new IllegalArgumentException("Invalid encoding");
+ throw new ArgumentError("Invalid encoding");
}
}
return codeUnitsBuffer;
@@ -139,7 +139,7 @@ List<int> _utf16CodeUnitsToCodepoints(
/**
* An Iterator<int> of codepoints built on an Iterator of UTF-16 code units.
* The parameters can override the default Unicode replacement character. Set
- * the replacementCharacter to null to throw an IllegalArgumentException
+ * the replacementCharacter to null to throw an ArgumentError
* rather than replace the bad value.
*/
class Utf16CodeUnitDecoder implements Iterator<int> {
@@ -166,7 +166,7 @@ class Utf16CodeUnitDecoder implements Iterator<int> {
if (replacementCodepoint != null) {
return replacementCodepoint;
} else {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
"Invalid UTF16 at ${utf16CodeUnitIterator.position}");
}
} else if (value < UNICODE_UTF16_RESERVED_LO ||
@@ -191,14 +191,14 @@ class Utf16CodeUnitDecoder implements Iterator<int> {
if (replacementCodepoint != null) {
return replacementCodepoint;
} else {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
"Invalid UTF16 at ${utf16CodeUnitIterator.position}");
}
}
} else if (replacementCodepoint != null) {
return replacementCodepoint;
} else {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
"Invalid UTF16 at ${utf16CodeUnitIterator.position}");
}
}

Powered by Google App Engine
This is Rietveld 408576698