add return types for indexOf and lastIndexOf

closes #1277
This commit is contained in:
Jeremy Elbourn 2015-04-09 11:51:00 -07:00 committed by Misko Hevery
parent 678d541da7
commit afe5465862
1 changed files with 3 additions and 0 deletions

View File

@ -94,6 +94,9 @@ class ListWrapper {
static bool contains(List m, k) => m.contains(k);
static List map(list, fn(item)) => list.map(fn).toList();
static List filter(List list, bool fn(item)) => list.where(fn).toList();
static int indexOf(List list, value, [int startIndex = 0]) => list.indexOf(value, startIndex);
static int lastIndexOf(List list, value, [int startIndex = null]) =>
list.lastIndexOf(value, startIndex == null ? list.length : startIndex);
static find(List list, bool fn(item)) =>
list.firstWhere(fn, orElse: () => null);
static bool any(List list, bool fn(item)) => list.any(fn);