fix(compiler_cli): allow to use builtin directives like NgIf
, …
Related to #8448 Closes #8454
This commit is contained in:
@ -11,5 +11,5 @@ export interface PlatformReflectionCapabilities {
|
||||
getter(name: string): GetterFn;
|
||||
setter(name: string): SetterFn;
|
||||
method(name: string): MethodFn;
|
||||
importUri(type: Type): string;
|
||||
importUri(type: any): string;
|
||||
}
|
||||
|
@ -342,7 +342,12 @@ class ReflectionCapabilities implements PlatformReflectionCapabilities {
|
||||
return classMirror.metadata;
|
||||
}
|
||||
|
||||
String importUri(Type type) {
|
||||
String importUri(dynamic type) {
|
||||
// StaticSymbol
|
||||
if (type is Map && type['filePath'] != null) {
|
||||
return type['filePath'];
|
||||
}
|
||||
// Runtime type
|
||||
return '${(reflectClass(type).owner as LibraryMirror).uri}';
|
||||
}
|
||||
}
|
||||
|
@ -214,7 +214,14 @@ export class ReflectionCapabilities implements PlatformReflectionCapabilities {
|
||||
}
|
||||
|
||||
// There is not a concept of import uri in Js, but this is useful in developing Dart applications.
|
||||
importUri(type: Type): string { return `./${stringify(type)}`; }
|
||||
importUri(type: any): string {
|
||||
// StaticSymbol
|
||||
if (typeof type === 'object' && type['filePath']) {
|
||||
return type['filePath'];
|
||||
}
|
||||
// Runtime type
|
||||
return `./${stringify(type)}`;
|
||||
}
|
||||
}
|
||||
|
||||
function convertTsickleDecoratorIntoMetadata(decoratorInvocations: any[]): any[] {
|
||||
|
@ -45,6 +45,10 @@ export class Reflector extends ReflectorReader {
|
||||
this.reflectionCapabilities = reflectionCapabilities;
|
||||
}
|
||||
|
||||
updateCapabilities(caps: PlatformReflectionCapabilities) {
|
||||
this.reflectionCapabilities = caps;
|
||||
}
|
||||
|
||||
isReflectionEnabled(): boolean { return this.reflectionCapabilities.isReflectionEnabled(); }
|
||||
|
||||
/**
|
||||
@ -160,7 +164,7 @@ export class Reflector extends ReflectorReader {
|
||||
/** @internal */
|
||||
_containsReflectionInfo(typeOrFunc: any) { return this._injectableInfo.has(typeOrFunc); }
|
||||
|
||||
importUri(type: Type): string { return this.reflectionCapabilities.importUri(type); }
|
||||
importUri(type: any): string { return this.reflectionCapabilities.importUri(type); }
|
||||
}
|
||||
|
||||
function _mergeMaps(target: Map<string, Function>, config: {[key: string]: Function}): void {
|
||||
|
Reference in New Issue
Block a user