mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 21:06:50 -05:00
program.getSourceFile[ByPath] can return undefined
This commit is contained in:
@@ -969,11 +969,11 @@ namespace ts {
|
||||
return emitResult;
|
||||
}
|
||||
|
||||
function getSourceFile(fileName: string): SourceFile {
|
||||
function getSourceFile(fileName: string): SourceFile | undefined {
|
||||
return getSourceFileByPath(toPath(fileName, currentDirectory, getCanonicalFileName));
|
||||
}
|
||||
|
||||
function getSourceFileByPath(path: Path): SourceFile {
|
||||
function getSourceFileByPath(path: Path): SourceFile | undefined {
|
||||
return filesByName.get(path);
|
||||
}
|
||||
|
||||
|
||||
@@ -2352,8 +2352,8 @@ namespace ts {
|
||||
|
||||
export interface ScriptReferenceHost {
|
||||
getCompilerOptions(): CompilerOptions;
|
||||
getSourceFile(fileName: string): SourceFile;
|
||||
getSourceFileByPath(path: Path): SourceFile;
|
||||
getSourceFile(fileName: string): SourceFile | undefined;
|
||||
getSourceFileByPath(path: Path): SourceFile | undefined;
|
||||
getCurrentDirectory(): string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user