fix(compiler): no longer uses assetCacheKey for token identity.

Fixes #10545, Fixes #10538
This commit is contained in:
Chuck Jazdzewski
2016-08-24 17:39:49 -07:00
committed by Victor Berchet
parent c377e80670
commit 51877ef4ed
27 changed files with 588 additions and 373 deletions

View File

@ -42,6 +42,16 @@ 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);
}
resolveEnum(enumType: any, name: string): any {
if (isStaticType(enumType)) {
return this.staticDelegate.resolveEnum(enumType, name);
} else {
return null;
}
}
}
function isStaticType(type: any): boolean {

View File

@ -74,6 +74,16 @@ export class StaticReflector implements ReflectorReader {
return staticSymbol ? staticSymbol.filePath : null;
}
resolveType(name: string, moduleUrl: string): any {
const result = this.host.findDeclaration(moduleUrl, name, '');
return result;
}
resolveEnum(enumType: any, name: string): any {
const staticSymbol: StaticSymbol = enumType;
return this.host.getStaticSymbol(staticSymbol.filePath, staticSymbol.name, [name]);
}
public annotations(type: StaticSymbol): any[] {
let annotations = this.annotationCache.get(type);
if (!annotations) {