refactor(ListWrapper): drop forEach and removeLast

Closes #4584
This commit is contained in:
Victor Berchet
2015-10-07 09:09:43 -07:00
parent 4ed642f921
commit aee176115b
35 changed files with 71 additions and 104 deletions

View File

@ -8,7 +8,7 @@ import {
} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
import {Map, MapWrapper, StringMapWrapper, ListWrapper} from 'angular2/src/core/facade/collection';
import {Map, MapWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
import {RouteHandler} from './route_handler';
import {Url, RootUrl, serializeParams} from './url_parser';
@ -35,7 +35,7 @@ class TouchMap {
getUnused(): {[key: string]: any} {
var unused: {[key: string]: any} = StringMapWrapper.create();
var keys = StringMapWrapper.keys(this.keys);
ListWrapper.forEach(keys, (key) => { unused[key] = StringMapWrapper.get(this.map, key); });
keys.forEach(key => unused[key] = StringMapWrapper.get(this.map, key));
return unused;
}
}

View File

@ -89,7 +89,8 @@ export class RouteRegistry {
var annotation = annotations[i];
if (annotation instanceof RouteConfig) {
ListWrapper.forEach(annotation.configs, (config) => this.config(component, config));
let routeCfgs: RouteDefinition[] = annotation.configs;
routeCfgs.forEach(config => this.config(component, config));
}
}
}

View File

@ -427,7 +427,7 @@ export class Router {
}
if (rest[rest.length - 1] == '') {
ListWrapper.removeLast(rest);
rest.pop();
}
if (rest.length < 1) {