Skip to content

Commit

Permalink
fix(language-service): be resilient to invalidate ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckjaz committed Mar 24, 2017
1 parent 92084f2 commit f7f313d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/language-service/src/typescript_host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ export class TypeScriptServiceHost implements LanguageServiceHost {
const type = this.checker.getTypeAtLocation(target);
if (type) {
const staticSymbol =
this._reflector.getStaticSymbol(sourceFile.fileName, classDeclaration.name.text);
this.reflector.getStaticSymbol(sourceFile.fileName, classDeclaration.name.text);
try {
if (this.resolver.isDirective(staticSymbol as any)) {
const {metadata} =
Expand Down
9 changes: 9 additions & 0 deletions packages/language-service/test/diagnostics_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ describe('diagnostics', () => {
includeDiagnostic(diagnostics(template), message, at, len);
}

describe('regression', () => {
it('should be able to return diagnostics if reflector gets invalidated', () => {
const fileName = '/app/main.ts';
ngService.getDiagnostics(fileName);
(ngHost as any)._reflector = null;
ngService.getDiagnostics(fileName);
});
});

describe('with $event', () => {
it('should accept an event',
() => { accept('<div (click)="myClick($event)">Click me!</div>'); });
Expand Down

0 comments on commit f7f313d

Please sign in to comment.