fix(language-service): Fix crash when no script files are found (#20550)
Fixes the crash in typescript host when getScriptFileNames() returns an empty array. PR Close #19325 PR Close #20550
This commit is contained in:

committed by
Miško Hevery

parent
ba850b36de
commit
54bfe14313
@ -39,4 +39,11 @@ describe('completions', () => {
|
||||
ngHost = new TypeScriptServiceHost(host, service);
|
||||
expect(ngHost.getAnalyzedModules()).toBeDefined();
|
||||
});
|
||||
|
||||
it('should not throw if there is no script names', () => {
|
||||
host = new MockTypescriptHost([], toh);
|
||||
service = ts.createLanguageService(host);
|
||||
ngHost = new TypeScriptServiceHost(host, service);
|
||||
expect(() => ngHost.getAnalyzedModules()).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user