Skip to content

Commit

Permalink
Bump version to 4.9.4 and LKG.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRosenwasser authored Dec 6, 2022
1 parent eb5419f commit e286821
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 104 deletions.
42 changes: 25 additions & 17 deletions lib/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
var ts;
(function (ts) {
ts.versionMajorMinor = "4.9";
ts.version = "".concat(ts.versionMajorMinor, ".3");
ts.version = "".concat(ts.versionMajorMinor, ".4");
var NativeCollections;
(function (NativeCollections) {
var globals = typeof globalThis !== "undefined" ? globalThis :
Expand Down Expand Up @@ -57536,7 +57536,8 @@ var ts;
return !!(type.flags & 109440);
}
function isUnitLikeType(type) {
return isUnitType(getBaseConstraintOrType(type));
var t = getBaseConstraintOrType(type);
return t.flags & 2097152 ? ts.some(t.types, isUnitType) : isUnitType(t);
}
function extractUnitType(type) {
return type.flags & 2097152 ? ts.find(type.types, isUnitType) || type : type;
Expand Down Expand Up @@ -66236,11 +66237,11 @@ var ts;
}
function checkSatisfiesExpression(node) {
checkSourceElement(node.type);
var exprType = checkExpression(node.expression);
var targetType = getTypeFromTypeNode(node.type);
if (isErrorType(targetType)) {
return targetType;
}
var exprType = checkExpression(node.expression);
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
return exprType;
}
Expand Down Expand Up @@ -77596,8 +77597,8 @@ var ts;
_a[302] = function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
},
_a[308] = function visitEachChildOfSourceFile(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context, undefined, undefined, nodesVisitor));
_a[308] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
},
_a[353] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
return context.factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
Expand Down Expand Up @@ -104718,12 +104719,13 @@ var ts;
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
return {
var compilerHost = {
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
var text;
try {
ts.performance.mark("beforeIORead");
text = host.readFile(fileName, getCompilerOptions().charset);
var encoding = getCompilerOptions().charset;
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
ts.performance.mark("afterIORead");
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
}
Expand Down Expand Up @@ -104754,6 +104756,7 @@ var ts;
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
};
return compilerHost;
function writeFile(fileName, text, writeByteOrderMark, onError) {
try {
ts.performance.mark("beforeIOWrite");
Expand All @@ -104769,9 +104772,9 @@ var ts;
}
}
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
function setGetSourceFileAsHashVersioned(compilerHost, host) {
function setGetSourceFileAsHashVersioned(compilerHost) {
var originalGetSourceFile = compilerHost.getSourceFile;
var computeHash = ts.maybeBind(host, host.createHash) || ts.generateDjb2Hash;
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
compilerHost.getSourceFile = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
Expand Down Expand Up @@ -104887,7 +104890,7 @@ var ts;
host.createHash = ts.maybeBind(system, system.createHash);
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
ts.setGetSourceFileAsHashVersioned(host, system);
ts.setGetSourceFileAsHashVersioned(host);
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
return host;
}
Expand Down Expand Up @@ -104972,7 +104975,7 @@ var ts;
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
}
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
ts.setGetSourceFileAsHashVersioned(compilerHost, host);
ts.setGetSourceFileAsHashVersioned(compilerHost);
var getNewSourceFile = compilerHost.getSourceFile;
compilerHost.getSourceFile = function (fileName) {
var args = [];
Expand Down Expand Up @@ -105092,8 +105095,8 @@ var ts;
}
}
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
if (hasChangedConfigFileParsingErrors) {
if (reportFileChangeDetectedOnCreateProgram) {
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
Expand Down Expand Up @@ -105218,9 +105221,14 @@ var ts;
}
}
}
function getSourceVersion(path) {
function getSourceVersion(path, readFileWithCache) {
var hostSourceFile = sourceFilesCache.get(path);
return !hostSourceFile || !hostSourceFile.version ? undefined : hostSourceFile.version;
if (!hostSourceFile)
return undefined;
if (hostSourceFile.version)
return hostSourceFile.version;
var text = readFileWithCache(path);
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
}
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
Expand Down Expand Up @@ -105652,7 +105660,7 @@ var ts;
var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
ts.setGetSourceFileAsHashVersioned(compilerHost, host);
ts.setGetSourceFileAsHashVersioned(compilerHost);
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
Expand Down Expand Up @@ -106634,7 +106642,7 @@ var ts;
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
currentVersion = text && (host.createHash || ts.generateDjb2Hash)(text);
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
if (version_3 && version_3 === currentVersion)
pseudoInputUpToDate = true;
}
Expand Down
45 changes: 28 additions & 17 deletions lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var ts;
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
ts.version = "".concat(ts.versionMajorMinor, ".3");
ts.version = "".concat(ts.versionMajorMinor, ".4");
/* @internal */
var Comparison;
(function (Comparison) {
Expand Down Expand Up @@ -68904,7 +68904,10 @@ var ts;
return !!(type.flags & 109440 /* TypeFlags.Unit */);
}
function isUnitLikeType(type) {
return isUnitType(getBaseConstraintOrType(type));
// Intersections that reduce to 'never' (e.g. 'T & null' where 'T extends {}') are not unit types.
var t = getBaseConstraintOrType(type);
// Scan intersections such that tagged literal types are considered unit types.
return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.some(t.types, isUnitType) : isUnitType(t);
}
function extractUnitType(type) {
return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
Expand Down Expand Up @@ -79084,11 +79087,11 @@ var ts;
}
function checkSatisfiesExpression(node) {
checkSourceElement(node.type);
var exprType = checkExpression(node.expression);
var targetType = getTypeFromTypeNode(node.type);
if (isErrorType(targetType)) {
return targetType;
}
var exprType = checkExpression(node.expression);
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
return exprType;
}
Expand Down Expand Up @@ -91973,8 +91976,8 @@ var ts;
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
},
// Top-level nodes
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context, /*start*/ undefined, /*ensureUseStrict*/ undefined, nodesVisitor));
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
},
// Transformation nodes
_a[353 /* SyntaxKind.PartiallyEmittedExpression */] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
Expand Down Expand Up @@ -126211,12 +126214,13 @@ var ts;
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
return {
var compilerHost = {
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
var text;
try {
ts.performance.mark("beforeIORead");
text = host.readFile(fileName, getCompilerOptions().charset);
var encoding = getCompilerOptions().charset;
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
ts.performance.mark("afterIORead");
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
}
Expand Down Expand Up @@ -126247,6 +126251,7 @@ var ts;
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
};
return compilerHost;
function writeFile(fileName, text, writeByteOrderMark, onError) {
try {
ts.performance.mark("beforeIOWrite");
Expand All @@ -126265,9 +126270,9 @@ var ts;
}
}
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
function setGetSourceFileAsHashVersioned(compilerHost, host) {
function setGetSourceFileAsHashVersioned(compilerHost) {
var originalGetSourceFile = compilerHost.getSourceFile;
var computeHash = ts.maybeBind(host, host.createHash) || ts.generateDjb2Hash;
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
compilerHost.getSourceFile = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
Expand Down Expand Up @@ -126399,7 +126404,7 @@ var ts;
host.createHash = ts.maybeBind(system, system.createHash);
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
ts.setGetSourceFileAsHashVersioned(host, system);
ts.setGetSourceFileAsHashVersioned(host);
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
return host;
}
Expand Down Expand Up @@ -126485,7 +126490,7 @@ var ts;
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
}
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
ts.setGetSourceFileAsHashVersioned(compilerHost, host);
ts.setGetSourceFileAsHashVersioned(compilerHost);
// Members for CompilerHost
var getNewSourceFile = compilerHost.getSourceFile;
compilerHost.getSourceFile = function (fileName) {
Expand Down Expand Up @@ -126613,8 +126618,8 @@ var ts;
}
}
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
if (hasChangedConfigFileParsingErrors) {
if (reportFileChangeDetectedOnCreateProgram) {
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
Expand Down Expand Up @@ -126753,9 +126758,15 @@ var ts;
}
}
}
function getSourceVersion(path) {
function getSourceVersion(path, readFileWithCache) {
var hostSourceFile = sourceFilesCache.get(path);
return !hostSourceFile || !hostSourceFile.version ? undefined : hostSourceFile.version;
if (!hostSourceFile)
return undefined;
if (hostSourceFile.version)
return hostSourceFile.version;
// Read file and get new version
var text = readFileWithCache(path);
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
}
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
Expand Down Expand Up @@ -127249,7 +127260,7 @@ var ts;
// State of the solution
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
ts.setGetSourceFileAsHashVersioned(compilerHost, host);
ts.setGetSourceFileAsHashVersioned(compilerHost);
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
Expand Down Expand Up @@ -128282,7 +128293,7 @@ var ts;
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
currentVersion = text && (host.createHash || ts.generateDjb2Hash)(text);
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
if (version_3 && version_3 === currentVersion)
pseudoInputUpToDate = true;
}
Expand Down
Loading

0 comments on commit e286821

Please sign in to comment.