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

Unified Diff: lib/byte_array.cc

Issue 11639007: Cleanup the exceptions create code to use Arrays instead GrowableArrays so (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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
« no previous file with comments | « lib/array.cc ('k') | lib/date.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/byte_array.cc
===================================================================
--- lib/byte_array.cc (revision 16285)
+++ lib/byte_array.cc (working copy)
@@ -23,8 +23,8 @@
const String& error = String::Handle(String::NewFormatted(
"index (%"Pd") must be in the range [0..%"Pd")",
index, (array.ByteLength() / num_bytes)));
- GrowableArray<const Object*> args;
- args.Add(&error);
+ const Array& args = Array::Handle(Array::New(1));
+ args.SetAt(0, error);
Exceptions::ThrowByType(Exceptions::kRange, args);
}
}
@@ -36,8 +36,8 @@
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);
+ const Array& args = Array::Handle(Array::New(1));
+ args.SetAt(0, error);
Exceptions::ThrowByType(Exceptions::kArgument, args);
}
}
@@ -265,8 +265,8 @@
if (length_value < 0) {
const String& error = String::Handle(String::NewFormatted(
"length (%"Pd") must be non-negative", length_value));
- GrowableArray<const Object*> args;
- args.Add(&error);
+ const Array& args = Array::Handle(Array::New(1));
+ args.SetAt(0, error);
Exceptions::ThrowByType(Exceptions::kArgument, args);
}
RangeCheck(src, src_start_value, length_value);
« no previous file with comments | « lib/array.cc ('k') | lib/date.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698