fix(compiler): allow decorators defined in the same file

This commit is contained in:
Alex Eagle 2016-05-07 08:58:20 -06:00
parent 0d71345b93
commit c1154b30c7
2 changed files with 11 additions and 1 deletions

View File

@ -19,3 +19,9 @@ export function NotADirective(c: any): void {}
@NotADirective
export class HasCustomDecorator {
}
// Verify that custom decorators have metadata collected, eg Ionic
export function Page(c: any): (f: Function) => void {return c;}
@Page({template: 'Ionic template'})
export class AnIonicPage {}

View File

@ -345,8 +345,12 @@ export class StaticReflector implements ReflectorReader {
case "new":
case "call":
let target = expression['expression'];
staticSymbol =
if (target['module']) {
staticSymbol =
_this.host.findDeclaration(target['module'], target['name'], context.filePath);
} else {
staticSymbol = _this.host.getStaticSymbol(context.filePath, target['name']);
}
let converter = _this.conversionMap.get(staticSymbol);
if (converter) {
let args = expression['arguments'];