diff --git a/modules/facade/src/collection.dart b/modules/facade/src/collection.dart index 4ec9eecbad..4557fedf41 100644 --- a/modules/facade/src/collection.dart +++ b/modules/facade/src/collection.dart @@ -101,9 +101,7 @@ class ListWrapper { list.remove(items[i]); } } - static remove(List list, item) { - list.remove(item); - } + static bool remove(List list, item) => list.remove(item); static void clear(List l) { l.clear(); } static String join(List l, String s) => l.join(s); static bool isEmpty(list) => list.isEmpty; diff --git a/modules/facade/src/collection.es6 b/modules/facade/src/collection.es6 index 4f37a5c1ee..49ebc0b088 100644 --- a/modules/facade/src/collection.es6 +++ b/modules/facade/src/collection.es6 @@ -149,9 +149,13 @@ export class ListWrapper { list.splice(index, 1); } } - static remove(list, item) { - var index = list.indexOf(item); - list.splice(index, 1); + static remove(list, el): boolean { + var index = list.indexOf(el); + if (index > -1) { + list.splice(index, 1); + return true; + } + return false; } static clear(list) { list.splice(0, list.length);