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

Unified Diff: lib/growable_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/double.cc ('k') | lib/integers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/growable_array.cc
===================================================================
--- lib/growable_array.cc (revision 16285)
+++ lib/growable_array.cc (working copy)
@@ -20,8 +20,8 @@
GET_NON_NULL_NATIVE_ARGUMENT(Array, data, arguments->NativeArgAt(1));
if ((data.Length() <= 0)) {
const Integer& index = Integer::Handle(Integer::New(data.Length()));
- GrowableArray<const Object*> args;
- args.Add(&index);
+ const Array& args = Array::Handle(Array::New(1));
+ args.SetAt(0, index);
Exceptions::ThrowByType(Exceptions::kRange, args);
}
const GrowableObjectArray& new_array =
@@ -36,8 +36,8 @@
GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Smi, index, arguments->NativeArgAt(1));
if ((index.Value() < 0) || (index.Value() >= array.Length())) {
- GrowableArray<const Object*> args;
- args.Add(&index);
+ const Array& args = Array::Handle(Array::New(1));
+ args.SetAt(0, index);
Exceptions::ThrowByType(Exceptions::kRange, args);
}
const Instance& obj = Instance::CheckedHandle(array.At(index.Value()));
@@ -50,8 +50,8 @@
GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Smi, index, arguments->NativeArgAt(1));
if ((index.Value() < 0) || (index.Value() >= array.Length())) {
- GrowableArray<const Object*> args;
- args.Add(&index);
+ const Array& args = Array::Handle(Array::New(1));
+ args.SetAt(0, index);
Exceptions::ThrowByType(Exceptions::kRange, args);
}
GET_NON_NULL_NATIVE_ARGUMENT(Instance, value, arguments->NativeArgAt(2));
@@ -79,8 +79,8 @@
GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Smi, length, arguments->NativeArgAt(1));
if ((length.Value() < 0) || (length.Value() > array.Capacity())) {
- GrowableArray<const Object*> args;
- args.Add(&length);
+ const Array& args = Array::Handle(Array::New(1));
+ args.SetAt(0, length);
Exceptions::ThrowByType(Exceptions::kRange, args);
}
array.SetLength(length.Value());
« no previous file with comments | « lib/double.cc ('k') | lib/integers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698