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

Unified Diff: lib/utf/utf32.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/utf32.dart
diff --git a/lib/utf/utf32.dart b/lib/utf/utf32.dart
index 8ef448295bd94555310b1bca1f648d1b72830d45..6f1176862bc6d23543e54314751322be51cf2e83 100644
--- a/lib/utf/utf32.dart
+++ b/lib/utf/utf32.dart
@@ -6,7 +6,7 @@
* Decodes the UTF-32 bytes as an iterable. Thus, the consumer can only convert
* as much of the input as needed. Determines the byte order from the BOM,
* or uses big-endian as a default. This method always strips a leading BOM.
- * Set the replacementCharacter to null to throw an IllegalArgumentException
+ * Set the replacementCharacter to null to throw an ArgumentError
* rather than replace the bad value.
*/
IterableUtf32Decoder decodeUtf32AsIterable(List<int> bytes, [
@@ -20,7 +20,7 @@ IterableUtf32Decoder decodeUtf32AsIterable(List<int> bytes, [
* Decodes the UTF-32BE bytes as an iterable. Thus, the consumer can only convert
* as much of the input as needed. This method strips a leading BOM by default,
* but can be overridden by setting the optional parameter [stripBom] to false.
- * Set the replacementCharacter to null to throw an IllegalArgumentException
+ * Set the replacementCharacter to null to throw an ArgumentError
* rather than replace the bad value.
*/
IterableUtf32Decoder decodeUtf32beAsIterable(List<int> bytes, [
@@ -35,7 +35,7 @@ IterableUtf32Decoder decodeUtf32beAsIterable(List<int> bytes, [
* Decodes the UTF-32LE bytes as an iterable. Thus, the consumer can only convert
* as much of the input as needed. This method strips a leading BOM by default,
* but can be overridden by setting the optional parameter [stripBom] to false.
- * Set the replacementCharacter to null to throw an IllegalArgumentException
+ * Set the replacementCharacter to null to throw an ArgumentError
* rather than replace the bad value.
*/
IterableUtf32Decoder decodeUtf32leAsIterable(List<int> bytes, [
@@ -51,7 +51,7 @@ IterableUtf32Decoder decodeUtf32leAsIterable(List<int> bytes, [
* allow an offset into a list of bytes (as int), limiting the length of the
* values be decoded and the ability of override the default Unicode
* replacement character. Set the replacementCharacter to null to throw an
- * IllegalArgumentException rather than replace the bad value.
+ * ArgumentError rather than replace the bad value.
*/
String decodeUtf32(List<int> bytes, [int offset = 0, int length,
int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
@@ -63,7 +63,7 @@ String decodeUtf32(List<int> bytes, [int offset = 0, int length,
* allow an offset into a list of bytes (as int), limiting the length of the
* values be decoded and the ability of override the default Unicode
* replacement character. Set the replacementCharacter to null to throw an
- * IllegalArgumentException rather than replace the bad value.
+ * ArgumentError rather than replace the bad value.
*/
String decodeUtf32be(
List<int> bytes, [int offset = 0, int length, bool stripBom = true,
@@ -76,7 +76,7 @@ String decodeUtf32be(
* allow an offset into a list of bytes (as int), limiting the length of the
* values be decoded and the ability of override the default Unicode
* replacement character. Set the replacementCharacter to null to throw an
- * IllegalArgumentException rather than replace the bad value.
+ * ArgumentError rather than replace the bad value.
*/
String decodeUtf32le(
List<int> bytes, [int offset = 0, int length, bool stripBom = true,
@@ -232,7 +232,7 @@ class Utf32BytesDecoder implements _ListRangeIterator {
if (replacementCodepoint != null) {
return replacementCodepoint;
} else {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
"Invalid UTF32 at ${utf32EncodedBytesIterator.position}");
}
} else {
@@ -242,7 +242,7 @@ class Utf32BytesDecoder implements _ListRangeIterator {
} else if (replacementCodepoint != null) {
return replacementCodepoint;
} else {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
"Invalid UTF32 at ${utf32EncodedBytesIterator.position}");
}
}

Powered by Google App Engine
This is Rietveld 408576698