Chromium Code Reviews| Index: runtime/lib/byte_array.dart |
| diff --git a/runtime/lib/byte_array.dart b/runtime/lib/byte_array.dart |
| index a08cfbaf799bb9709edfdff19b5a258576e45314..eaaeff2e223ddb18cbe2a866acd7ab3d5acfc6f4 100644 |
| --- a/runtime/lib/byte_array.dart |
| +++ b/runtime/lib/byte_array.dart |
| @@ -260,6 +260,13 @@ abstract class _ByteArrayBase { |
| "Cannot remove from a non-extendable array"); |
| } |
| + int indexOf(var element, [int start = 0]) { |
|
Søren Gjesse
2012/05/09 07:08:03
Normally we just leave out var in argument lists.
Anders Johnsen
2012/05/09 07:12:04
Done.
|
| + for (int i = start; i < length; i++) { |
| + if (this[i] == element) return i; |
| + } |
| + return -1; |
| + } |
| + |
| void insertRange(int start, int length, [initialValue]) { |
| throw const UnsupportedOperationException( |
| "Cannot add to a non-extendable array"); |