feat(ElementInjector): throw when encounter a cyclic dependency

This commit is contained in:
vsavkin
2014-10-27 13:02:46 -04:00
parent b0c9d05ea7
commit 9bd65abb32
5 changed files with 70 additions and 31 deletions

View File

@ -31,7 +31,7 @@ class ListWrapper {
static List createFixedSize(int size) => new List(size);
static get(m, k) => m[k];
static void set(m, k, v) { m[k] = v; }
static contains(m, k) => m.containsKey(k);
static contains(List m, k) => m.contains(k);
static map(list, fn) => list.map(fn).toList();
static filter(List list, fn) => list.where(fn).toList();
static find(List list, fn) => list.firstWhere(fn, orElse:() => null);

View File

@ -69,6 +69,9 @@ export class ListWrapper {
}
return false;
}
static contains(list:List, el) {
return list.indexOf(el) !== -1;
}
static reversed(array) {
var a = ListWrapper.clone(array);
return a.reverse();