feat(change_detection): do not reparse AST when using generated detectors

This commit is contained in:
vsavkin
2015-08-19 11:26:45 -07:00
parent b986c54079
commit d2d0715568
31 changed files with 423 additions and 279 deletions
@@ -134,6 +134,12 @@ class ListWrapper {
list.forEach(fn);
}
static void forEachWithIndex(List list, fn(item, index)) {
for (var i = 0; i < list.length; ++i) {
fn(list[i], i);
}
}
static reduce(List list, fn(a, b), init) {
return list.fold(init, fn);
}
@@ -182,6 +182,11 @@ export class ListWrapper {
fn(array[i]);
}
}
static forEachWithIndex<T>(array: List<T>, fn: (T, number) => void) {
for (var i = 0; i < array.length; i++) {
fn(array[i], i);
}
}
static first<T>(array: List<T>): T {
if (!array) return null;
return array[0];