Handle failure to properly resolve type reference directives

This commit is contained in:
uniqueiniquity 2017-11-30 10:22:41 -08:00
parent cc6d18e4db
commit 30da23fa77

View File

@ -25000,10 +25000,11 @@ namespace ts {
// populate reverse mapping: file path -> type reference directive that was resolved to this file
fileToDirective = createMap<string>();
resolvedTypeReferenceDirectives.forEach((resolvedDirective, key) => {
if (!resolvedDirective) {
if (!resolvedDirective || !resolvedDirective.resolvedFileName) {
return;
}
const file = host.getSourceFile(resolvedDirective.resolvedFileName);
Debug.assert(!!file, `Resolved filename ${resolvedDirective.resolvedFileName} did not map to existing source file. Consider enabling --preserveSymlinks if appropriate`); // tslint:disable-line
fileToDirective.set(file.path, key);
});
}