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

Unified Diff: runtime/lib/byte_array.cc

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: runtime/lib/byte_array.cc
diff --git a/runtime/lib/byte_array.cc b/runtime/lib/byte_array.cc
index bda6fd1c5cdd0f9acd8742fee7dd5d978dc0e580..10d9a89555bbc572b56f2c4455d650c52fad366f 100644
--- a/runtime/lib/byte_array.cc
+++ b/runtime/lib/byte_array.cc
@@ -31,14 +31,14 @@ static void RangeCheck(const ByteArray& array,
// Checks to see if a length is in the range [0..max]. If the length
-// is out of range, then an IllegalArgumentException is thrown.
+// is out of range, then an ArgumentError is thrown.
static void LengthCheck(intptr_t len, intptr_t max) {
if (len < 0 || len > max) {
const String& error = String::Handle(String::NewFormatted(
"length (%"Pd") must be in the range [0..%"Pd"]", len, max));
GrowableArray<const Object*> args;
args.Add(&error);
- Exceptions::ThrowByType(Exceptions::kIllegalArgument, args);
+ Exceptions::ThrowByType(Exceptions::kArgument, args);
}
}
@@ -266,7 +266,7 @@ DEFINE_NATIVE_ENTRY(ByteArray_setRange, 5) {
"length (%"Pd") must be non-negative", length_value));
GrowableArray<const Object*> args;
args.Add(&error);
- Exceptions::ThrowByType(Exceptions::kIllegalArgument, args);
+ Exceptions::ThrowByType(Exceptions::kArgument, args);
}
RangeCheck(src, src_start_value, length_value);
RangeCheck(dst, dst_start_value, length_value);

Powered by Google App Engine
This is Rietveld 408576698