fix(language-service): avoid throwing for invalid class declarations (#13257)
Fixes #13253
This commit is contained in:

committed by
Alex Rickabaugh

parent
5614c4ff0f
commit
93556a5720
@ -115,6 +115,12 @@ describe('diagnostics', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should not throw for an invalid class', () => {
|
||||
const code = ` @Component({template: ''}) class`;
|
||||
addCode(
|
||||
code, fileName => { expect(() => ngService.getDiagnostics(fileName)).not.toThrow(); });
|
||||
});
|
||||
|
||||
function addCode(code: string, cb: (fileName: string, content?: string) => void) {
|
||||
const fileName = '/app/app.component.ts';
|
||||
const originalContent = mockHost.getFileContent(fileName);
|
||||
|
Reference in New Issue
Block a user