Index: runtime/lib/growable_array.cc |
diff --git a/runtime/lib/growable_array.cc b/runtime/lib/growable_array.cc |
index 501cea6c17a34f73b575508df8616e81334743e2..48f7343f8d3c2df095dde0d0b56ed5a727414b4f 100644 |
--- a/runtime/lib/growable_array.cc |
+++ b/runtime/lib/growable_array.cc |
@@ -16,7 +16,7 @@ DEFINE_NATIVE_ENTRY(GrowableList_allocate, 2) { |
const TypeArguments& type_arguments = |
TypeArguments::CheckedHandle(arguments->NativeArgAt(0)); |
GET_NON_NULL_NATIVE_ARGUMENT(Array, data, arguments->NativeArgAt(1)); |
- if (data.Length() <= 0) { |
+ if (data.Length() < 0) { |
Exceptions::ThrowRangeError("length", |
Integer::Handle(Integer::New(data.Length())), |
0, // This is the limit the user sees. |
@@ -82,7 +82,7 @@ DEFINE_NATIVE_ENTRY(GrowableList_setData, 2) { |
const GrowableObjectArray& array = |
GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0)); |
GET_NON_NULL_NATIVE_ARGUMENT(Array, data, arguments->NativeArgAt(1)); |
- ASSERT(data.Length() > 0); |
+ ASSERT(data.Length() >= 0); |
array.SetData(data); |
return Object::null(); |
} |
@@ -91,7 +91,7 @@ DEFINE_NATIVE_ENTRY(GrowableList_setData, 2) { |
DEFINE_NATIVE_ENTRY(Internal_makeListFixedLength, 1) { |
GET_NON_NULL_NATIVE_ARGUMENT(GrowableObjectArray, array, |
arguments->NativeArgAt(0)); |
- return Array::MakeArray(array); |
+ return Array::MakeFixedLength(array, /* unique = */ true); |
} |