PR feedback.

This commit is contained in:
Sheetal Nandi 2018-11-21 09:03:26 -08:00
parent 6a37fd46fe
commit c7f8959034
3 changed files with 7 additions and 7 deletions

View file

@ -83,7 +83,7 @@ namespace ts {
let text: string | undefined;
try {
performance.mark("beforeIORead");
text = host.readFile(fileName);
text = compilerHost.readFile(fileName);
performance.mark("afterIORead");
performance.measure("I/O Read", "beforeIORead", "afterIORead");
}
@ -112,8 +112,8 @@ namespace ts {
if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) {
const parentDirectory = getDirectoryPath(directoryPath);
ensureDirectoriesExist(parentDirectory);
if (host.createDirectory) {
host.createDirectory(directoryPath);
if (compilerHost.createDirectory) {
compilerHost.createDirectory(directoryPath);
}
else {
system.createDirectory(directoryPath);
@ -181,7 +181,7 @@ namespace ts {
const newLine = getNewLineCharacter(options, () => system.newLine);
const realpath = system.realpath && ((path: string) => system.realpath!(path));
const host: CompilerHost = {
const compilerHost: CompilerHost = {
getSourceFile,
getDefaultLibLocation,
getDefaultLibFileName: options => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options)),
@ -200,7 +200,7 @@ namespace ts {
readDirectory: (path, extensions, include, exclude, depth) => system.readDirectory(path, extensions, include, exclude, depth),
createDirectory: d => system.createDirectory(d)
};
return host;
return compilerHost;
}
export function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray<Diagnostic> {

View file

@ -1230,7 +1230,7 @@ namespace ts {
return sourceFile;
};
// fileExits for any kind of extension
// fileExists for any kind of extension
host.fileExists = fileName => {
const key = toPath(fileName);
const value = fileExistsCache.get(key);

View file

@ -5015,7 +5015,7 @@ namespace ts {
/* @internal */ hasChangedAutomaticTypeDirectiveNames?: boolean;
createHash?(data: string): string;
// TODO: later handle this in better way in builder host instead once the ap
// TODO: later handle this in better way in builder host instead once the api for tsbuild finalizes and doesnt use compilerHost as base
/*@internal*/createDirectory?(directory: string): void;
}