Make the versions in the source file non zero when the source file is created

This commit is contained in:
Sheetal Nandi 2017-11-14 11:35:20 -08:00
parent c9a17f325b
commit 6d36a3d778

View File

@ -468,9 +468,9 @@ namespace ts {
else {
let fileWatcher: FileWatcher;
if (sourceFile) {
sourceFile.version = "0";
sourceFile.version = "1";
fileWatcher = watchFilePath(system, fileName, onSourceFileChange, path, writeLog);
sourceFilesCache.set(path, { sourceFile, version: 0, fileWatcher });
sourceFilesCache.set(path, { sourceFile, version: 1, fileWatcher });
}
else {
sourceFilesCache.set(path, "0");
@ -612,7 +612,7 @@ namespace ts {
resolutionCache.invalidateResolutionOfFile(path);
if (!isString(hostSourceFile)) {
hostSourceFile.fileWatcher.close();
sourceFilesCache.set(path, (hostSourceFile.version++).toString());
sourceFilesCache.set(path, (++hostSourceFile.version).toString());
}
}
else {