fix(language-service): correctly type undefined
fixes #13412 closes #13414
This commit is contained in:

committed by
Victor Berchet

parent
9ec0a4e105
commit
3a64ad895a
@ -141,6 +141,16 @@ describe('diagnostics', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// #13412
|
||||
it('should not report an error for using undefined', () => {
|
||||
const code =
|
||||
` @Component({template: \`<div *ngIf="something === undefined"></div>\`}) export class MyComponent { something = 'foo'; }})`;
|
||||
addCode(code, fileName => {
|
||||
const diagnostics = ngService.getDiagnostics(fileName);
|
||||
onlyModuleDiagnostics(diagnostics);
|
||||
});
|
||||
});
|
||||
|
||||
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