refactor: misc cleanup (#11654)
This commit is contained in:

committed by
Igor Minar

parent
51d73d3e4e
commit
fdb22bd185
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ListWrapper, Map, StringMapWrapper} from '../facade/collection';
|
||||
import {ListWrapper, StringMapWrapper} from '../facade/collection';
|
||||
import {isPresent} from '../facade/lang';
|
||||
|
||||
import {AnimationPlayer} from './animation_player';
|
||||
@ -47,12 +47,12 @@ export class ViewAnimationMap {
|
||||
getAllPlayers(): AnimationPlayer[] { return this._allPlayers; }
|
||||
|
||||
remove(element: any, animationName: string): void {
|
||||
var playersByAnimation = this._map.get(element);
|
||||
if (isPresent(playersByAnimation)) {
|
||||
var player = playersByAnimation[animationName];
|
||||
const playersByAnimation = this._map.get(element);
|
||||
if (playersByAnimation) {
|
||||
const player = playersByAnimation[animationName];
|
||||
delete playersByAnimation[animationName];
|
||||
var index = this._allPlayers.indexOf(player);
|
||||
ListWrapper.removeAt(this._allPlayers, index);
|
||||
const index = this._allPlayers.indexOf(player);
|
||||
this._allPlayers.splice(index, 1);
|
||||
|
||||
if (StringMapWrapper.isEmpty(playersByAnimation)) {
|
||||
this._map.delete(element);
|
||||
|
@ -121,7 +121,7 @@ export class ReflectiveProtoInjectorDynamicStrategy implements ReflectiveProtoIn
|
||||
constructor(protoInj: ReflectiveProtoInjector, public providers: ResolvedReflectiveProvider[]) {
|
||||
var len = providers.length;
|
||||
|
||||
this.keyIds = ListWrapper.createFixedSize(len);
|
||||
this.keyIds = new Array(len);
|
||||
|
||||
for (var i = 0; i < len; i++) {
|
||||
this.keyIds[i] = providers[i].key.id;
|
||||
@ -286,7 +286,7 @@ export class ReflectiveInjectorDynamicStrategy implements ReflectiveInjectorStra
|
||||
constructor(
|
||||
public protoStrategy: ReflectiveProtoInjectorDynamicStrategy,
|
||||
public injector: ReflectiveInjector_) {
|
||||
this.objs = ListWrapper.createFixedSize(protoStrategy.providers.length);
|
||||
this.objs = new Array(protoStrategy.providers.length);
|
||||
ListWrapper.fill(this.objs, UNDEFINED);
|
||||
}
|
||||
|
||||
@ -648,7 +648,7 @@ export class ReflectiveInjector_ implements ReflectiveInjector {
|
||||
|
||||
private _instantiateProvider(provider: ResolvedReflectiveProvider): any {
|
||||
if (provider.multiProvider) {
|
||||
var res = ListWrapper.createFixedSize(provider.resolvedFactories.length);
|
||||
var res = new Array(provider.resolvedFactories.length);
|
||||
for (var i = 0; i < provider.resolvedFactories.length; ++i) {
|
||||
res[i] = this._instantiate(provider, provider.resolvedFactories[i]);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export function ensureSlotCount(projectableNodes: any[][], expectedSlotCount: nu
|
||||
res = EMPTY_ARR;
|
||||
} else if (projectableNodes.length < expectedSlotCount) {
|
||||
var givenSlotCount = projectableNodes.length;
|
||||
res = ListWrapper.createFixedSize(expectedSlotCount);
|
||||
res = new Array(expectedSlotCount);
|
||||
for (var i = 0; i < expectedSlotCount; i++) {
|
||||
res[i] = (i < givenSlotCount) ? projectableNodes[i] : EMPTY_ARR;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Map, MapWrapper, Set, SetWrapper, StringMapWrapper} from '../facade/collection';
|
||||
import {MapWrapper, SetWrapper, StringMapWrapper} from '../facade/collection';
|
||||
import {isPresent} from '../facade/lang';
|
||||
import {Type} from '../type';
|
||||
import {PlatformReflectionCapabilities} from './platform_reflection_capabilities';
|
||||
@ -40,14 +40,9 @@ export class Reflector extends ReflectorReader {
|
||||
/** @internal */
|
||||
_methods = new Map<string, MethodFn>();
|
||||
/** @internal */
|
||||
_usedKeys: Set<any>;
|
||||
reflectionCapabilities: PlatformReflectionCapabilities;
|
||||
_usedKeys: Set<any> = null;
|
||||
|
||||
constructor(reflectionCapabilities: PlatformReflectionCapabilities) {
|
||||
super();
|
||||
this._usedKeys = null;
|
||||
this.reflectionCapabilities = reflectionCapabilities;
|
||||
}
|
||||
constructor(public reflectionCapabilities: PlatformReflectionCapabilities) { super(); }
|
||||
|
||||
updateCapabilities(caps: PlatformReflectionCapabilities) { this.reflectionCapabilities = caps; }
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import {Injectable} from '../di';
|
||||
import {Map, MapWrapper} from '../facade/collection';
|
||||
import {MapWrapper} from '../facade/collection';
|
||||
import {scheduleMicroTask} from '../facade/lang';
|
||||
import {NgZone} from '../zone/ng_zone';
|
||||
|
||||
@ -110,6 +110,7 @@ export class Testability implements PublicTestability {
|
||||
|
||||
getPendingRequestCount(): number { return this._pendingCount; }
|
||||
|
||||
/** @deprecated use findProviders */
|
||||
findBindings(using: any, provider: string, exactMatch: boolean): any[] {
|
||||
// TODO(juliemr): implement.
|
||||
return [];
|
||||
|
Reference in New Issue
Block a user