Index: runtime/lib/growable_array.dart |
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart |
index e9c10822432e6645cd313e0c37c30dc0b6bfb85c..ed5551a9d1296aadd442a3c0281affcb6fe5a433 100644 |
--- a/runtime/lib/growable_array.dart |
+++ b/runtime/lib/growable_array.dart |
@@ -198,18 +198,18 @@ class _GrowableList<T> implements List<T> { |
T get first { |
if (length > 0) return this[0]; |
- throw new StateError("No elements"); |
+ throw IterableElementError.noElement(); |
} |
T get last { |
if (length > 0) return this[length - 1]; |
- throw new StateError("No elements"); |
+ throw IterableElementError.noElement(); |
} |
T get single { |
if (length == 1) return this[0]; |
- if (length == 0) throw new StateError("No elements"); |
- throw new StateError("More than one element"); |
+ if (length == 0) throw IterableElementError.noElement(); |
+ throw IterableElementError.tooMany();; |
} |
int indexOf(Object element, [int start = 0]) { |