refactor(compiler): replace CompileIdentifierMap with regular Map

closes #11145

Also rename `CompileIdentifierMetadata.runtime` into `CompileIdentifierMetadata.reference`.

Also remove `CompileIdentifierMetadata.equalsTo` as
now it is enough to just check the `reference` fields for equality.
This commit is contained in:
Tobias Bosch
2016-08-29 08:52:25 -07:00
committed by Victor Berchet
parent 51877ef4ed
commit d7de5c4f8e
27 changed files with 347 additions and 471 deletions

View File

@ -42,12 +42,12 @@ export class StaticAndDynamicReflectionCapabilities {
setter(name: string) { return this.dynamicDelegate.setter(name); }
method(name: string) { return this.dynamicDelegate.method(name); }
importUri(type: any): string { return this.staticDelegate.importUri(type); }
resolveType(name: string, moduleUrl: string) {
return this.staticDelegate.resolveType(name, moduleUrl);
resolveIdentifier(name: string, moduleUrl: string, runtime: any) {
return this.staticDelegate.resolveIdentifier(name, moduleUrl, runtime);
}
resolveEnum(enumType: any, name: string): any {
if (isStaticType(enumType)) {
return this.staticDelegate.resolveEnum(enumType, name);
resolveEnum(enumIdentifier: any, name: string): any {
if (isStaticType(enumIdentifier)) {
return this.staticDelegate.resolveEnum(enumIdentifier, name);
} else {
return null;
}

View File

@ -74,13 +74,13 @@ export class StaticReflector implements ReflectorReader {
return staticSymbol ? staticSymbol.filePath : null;
}
resolveType(name: string, moduleUrl: string): any {
resolveIdentifier(name: string, moduleUrl: string, runtime: any): any {
const result = this.host.findDeclaration(moduleUrl, name, '');
return result;
}
resolveEnum(enumType: any, name: string): any {
const staticSymbol: StaticSymbol = enumType;
resolveEnum(enumIdentifier: any, name: string): any {
const staticSymbol: StaticSymbol = enumIdentifier;
return this.host.getStaticSymbol(staticSymbol.filePath, staticSymbol.name, [name]);
}