fix(ListWrapper): fix JS ListWrapper.remove()
This commit is contained in:
parent
8612af9c50
commit
211cb12413
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue