Skip to content

Commit afe5465

Browse files
jelbournmhevery
authored andcommitted
add return types for indexOf and lastIndexOf
closes angular#1277
1 parent 678d541 commit afe5465

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/angular2/src/facade/collection.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ class ListWrapper {
9494
static bool contains(List m, k) => m.contains(k);
9595
static List map(list, fn(item)) => list.map(fn).toList();
9696
static List filter(List list, bool fn(item)) => list.where(fn).toList();
97+
static int indexOf(List list, value, [int startIndex = 0]) => list.indexOf(value, startIndex);
98+
static int lastIndexOf(List list, value, [int startIndex = null]) =>
99+
list.lastIndexOf(value, startIndex == null ? list.length : startIndex);
97100
static find(List list, bool fn(item)) =>
98101
list.firstWhere(fn, orElse: () => null);
99102
static bool any(List list, bool fn(item)) => list.any(fn);

0 commit comments

Comments
 (0)