Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
TypeScript Bot committed Aug 13, 2020
1 parent a192551 commit f88f306
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 406 deletions.
60 changes: 4 additions & 56 deletions lib/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -84088,7 +84088,6 @@ var ts;
var projectReferenceRedirects;
var mapFromFileToProjectReferenceRedirects;
var mapFromToProjectReferenceRedirectSource;
var skippedTrippleSlashReferences;
var useSourceOfProjectReferenceRedirect = !!((_a = host.useSourceOfProjectReferenceRedirect) === null || _a === void 0 ? void 0 : _a.call(host)) &&
!options.disableSourceOfProjectReferenceRedirect;
var _c = updateHostForUseSourceOfProjectReferenceRedirect({
Expand Down Expand Up @@ -84194,7 +84193,6 @@ var ts;
getSourceFiles: function () { return files; },
getMissingFilePaths: function () { return missingFilePaths; },
getRefFileMap: function () { return refFileMap; },
getSkippedTrippleSlashReferences: function () { return skippedTrippleSlashReferences; },
getFilesByNameMap: function () { return filesByName; },
getCompilerOptions: function () { return options; },
getSyntacticDiagnostics: getSyntacticDiagnostics,
Expand Down Expand Up @@ -84444,7 +84442,6 @@ var ts;
}
var oldSourceFiles = oldProgram.getSourceFiles();
var seenPackageNames = new ts.Map();
var oldSkippedTrippleSlashReferences = oldProgram.getSkippedTrippleSlashReferences();
for (var _i = 0, oldSourceFiles_2 = oldSourceFiles; _i < oldSourceFiles_2.length; _i++) {
var oldSourceFile = oldSourceFiles_2[_i];
var newSourceFile = host.getSourceFileByPath
Expand Down Expand Up @@ -84494,9 +84491,6 @@ var ts;
if (!ts.arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) {
oldProgram.structureIsReused = 1;
}
if ((oldSkippedTrippleSlashReferences === null || oldSkippedTrippleSlashReferences === void 0 ? void 0 : oldSkippedTrippleSlashReferences.has(oldSourceFile.path)) && includeTripleslashReferencesFrom(newSourceFile)) {
oldProgram.structureIsReused = 1;
}
collectExternalModuleReferences(newSourceFile);
if (!ts.arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) {
oldProgram.structureIsReused = 1;
Expand Down Expand Up @@ -84565,7 +84559,6 @@ var ts;
}
missingFilePaths = oldProgram.getMissingFilePaths();
refFileMap = oldProgram.getRefFileMap();
skippedTrippleSlashReferences = oldSkippedTrippleSlashReferences;
ts.Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length);
for (var _g = 0, newSourceFiles_1 = newSourceFiles; _g < newSourceFiles_1.length; _g++) {
var newSourceFile = newSourceFiles_1[_g];
Expand Down Expand Up @@ -85488,14 +85481,7 @@ var ts;
}
return projectReferenceRedirects.get(projectReferencePath) || undefined;
}
function includeTripleslashReferencesFrom(file) {
return !host.includeTripleslashReferencesFrom || host.includeTripleslashReferencesFrom(file.originalFileName);
}
function processReferencedFiles(file, isDefaultLib) {
if (!includeTripleslashReferencesFrom(file)) {
(skippedTrippleSlashReferences || (skippedTrippleSlashReferences = new ts.Set())).add(file.path);
return;
}
ts.forEach(file.referencedFiles, function (ref, index) {
var referencedFileName = resolveTripleslashReference(ref.fileName, file.fileName);
processSourceFile(referencedFileName, isDefaultLib, false, undefined, {
Expand Down Expand Up @@ -87552,20 +87538,7 @@ var ts;
return true;
}
ts.canWatchDirectory = canWatchDirectory;
var ResolutionKind;
(function (ResolutionKind) {
ResolutionKind[ResolutionKind["All"] = 0] = "All";
ResolutionKind[ResolutionKind["RelativeReferencesInOpenFileOnly"] = 1] = "RelativeReferencesInOpenFileOnly";
})(ResolutionKind = ts.ResolutionKind || (ts.ResolutionKind = {}));
var noResolveResolvedModule = {
resolvedModule: undefined,
failedLookupLocations: []
};
var noResolveResolvedTypeReferenceDirective = {
resolvedTypeReferenceDirective: undefined,
failedLookupLocations: []
};
function createResolutionCache(resolutionHost, rootDirForResolution, resolutionKind, logChangesWhenResolvingModule) {
function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
var filesWithChangedSetOfUnresolvedImports;
var filesWithInvalidatedResolutions;
var filesWithInvalidatedNonRelativeUnresolvedImports;
Expand Down Expand Up @@ -87604,7 +87577,6 @@ var ts;
hasChangedAutomaticTypeDirectiveNames: function () { return hasChangedAutomaticTypeDirectiveNames; },
invalidateResolutionOfFile: invalidateResolutionOfFile,
invalidateResolutionsOfFailedLookupLocations: invalidateResolutionsOfFailedLookupLocations,
removeRelativeNoResolveResolutionsOfFile: removeRelativeNoResolveResolutionsOfFile,
setFilesWithInvalidatedNonRelativeUnresolvedImports: setFilesWithInvalidatedNonRelativeUnresolvedImports,
createHasInvalidatedResolution: createHasInvalidatedResolution,
updateTypeRootsWatch: updateTypeRootsWatch,
Expand Down Expand Up @@ -87701,7 +87673,7 @@ var ts;
}
function resolveNamesWithLocalCache(_a) {
var _b;
var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, noResolveResolution = _a.noResolveResolution, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges;
var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges;
var path = resolutionHost.toPath(containingFile);
var resolutionsInFile = cache.get(path) || cache.set(path, new ts.Map()).get(path);
var dirPath = ts.getDirectoryPath(path);
Expand Down Expand Up @@ -87732,10 +87704,7 @@ var ts;
resolution = resolutionInDirectory;
}
else {
resolution = resolutionKind === ResolutionKind.All ||
(ts.isExternalModuleNameRelative(name) && resolutionHost.fileIsOpen(path)) ?
loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference) :
noResolveResolution;
resolution = loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference);
perDirectoryResolution.set(name, resolution);
}
resolutionsInFile.set(name, resolution);
Expand Down Expand Up @@ -87787,7 +87756,6 @@ var ts;
loader: ts.resolveTypeReferenceDirective,
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; },
noResolveResolution: noResolveResolvedTypeReferenceDirective,
});
}
function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference) {
Expand All @@ -87802,7 +87770,6 @@ var ts;
shouldRetryResolution: function (resolution) { return !resolution.resolvedModule || !ts.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); },
reusedNames: reusedNames,
logChanges: logChangesWhenResolvingModule,
noResolveResolution: noResolveResolvedModule,
});
}
function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile) {
Expand Down Expand Up @@ -88036,25 +88003,6 @@ var ts;
resolutionHost.onChangedAutomaticTypeDirectiveNames();
}
}
function removeRelativeNoResolveResolutionsOfFileFromCache(cache, filePath, noResolveResolution) {
ts.Debug.assert(resolutionKind === ResolutionKind.RelativeReferencesInOpenFileOnly);
var resolutions = cache.get(filePath);
if (!resolutions)
return false;
var invalidated = false;
resolutions.forEach(function (resolution, name) {
if (resolution === noResolveResolution && ts.isExternalModuleNameRelative(name)) {
resolutions.delete(name);
invalidated = true;
}
});
return invalidated;
}
function removeRelativeNoResolveResolutionsOfFile(filePath) {
var invalidated = removeRelativeNoResolveResolutionsOfFileFromCache(resolvedModuleNames, filePath, noResolveResolvedModule);
invalidated = removeRelativeNoResolveResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, noResolveResolvedTypeReferenceDirective) || invalidated;
return invalidated;
}
function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) {
ts.Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === undefined);
filesWithInvalidatedNonRelativeUnresolvedImports = filesMap;
Expand Down Expand Up @@ -89022,7 +88970,7 @@ var ts;
compilerHost.writeLog = writeLog;
var resolutionCache = ts.createResolutionCache(compilerHost, configFileName ?
ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFileName, currentDirectory)) :
currentDirectory, ts.ResolutionKind.All, false);
currentDirectory, false);
compilerHost.resolveModuleNames = host.resolveModuleNames ?
(function () {
var args = [];
Expand Down
Loading

0 comments on commit f88f306

Please sign in to comment.