From afe54658623305baf79b5770ae3efaadfaa8676c Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Thu, 9 Apr 2015 11:51:00 -0700 Subject: [PATCH] add return types for indexOf and lastIndexOf closes #1277 --- modules/angular2/src/facade/collection.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/angular2/src/facade/collection.dart b/modules/angular2/src/facade/collection.dart index 60efec009c..17b8e534d7 100644 --- a/modules/angular2/src/facade/collection.dart +++ b/modules/angular2/src/facade/collection.dart @@ -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);