Index: runtime/lib/growable_array.dart |
=================================================================== |
--- runtime/lib/growable_array.dart (revision 957) |
+++ runtime/lib/growable_array.dart (working copy) |
@@ -117,6 +117,9 @@ |
} |
T operator [](int index) { |
+ if (index is !int) { |
+ throw new IllegalArgumentException("[] with $index"); |
+ } |
if (index >= _length) { |
throw new IndexOutOfRangeException(index); |
} |
@@ -124,7 +127,10 @@ |
} |
void operator []=(int index, T value) { |
- if (index >= _length) { |
+ if (index is !int) { |
+ throw new IllegalArgumentException("[]= with $index"); |
+ } |
+ if (index >= _length) { |
throw new IndexOutOfRangeException(index); |
} |
backingArray[index] = value; |