typescript 4.9.2-rc → 4.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +25 -17
- package/lib/tsserver.js +28 -17
- package/lib/tsserverlibrary.js +28 -17
- package/lib/typescript.js +28 -17
- package/lib/typescriptServices.js +28 -17
- package/lib/typingsInstaller.js +28 -17
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.9";
|
|
72
|
-
ts.version = "".concat(ts.versionMajorMinor, ".
|
|
72
|
+
ts.version = "".concat(ts.versionMajorMinor, ".4");
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -57536,7 +57536,8 @@ var ts;
|
|
|
57536
57536
|
return !!(type.flags & 109440);
|
|
57537
57537
|
}
|
|
57538
57538
|
function isUnitLikeType(type) {
|
|
57539
|
-
|
|
57539
|
+
var t = getBaseConstraintOrType(type);
|
|
57540
|
+
return t.flags & 2097152 ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
57540
57541
|
}
|
|
57541
57542
|
function extractUnitType(type) {
|
|
57542
57543
|
return type.flags & 2097152 ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -66236,11 +66237,11 @@ var ts;
|
|
|
66236
66237
|
}
|
|
66237
66238
|
function checkSatisfiesExpression(node) {
|
|
66238
66239
|
checkSourceElement(node.type);
|
|
66240
|
+
var exprType = checkExpression(node.expression);
|
|
66239
66241
|
var targetType = getTypeFromTypeNode(node.type);
|
|
66240
66242
|
if (isErrorType(targetType)) {
|
|
66241
66243
|
return targetType;
|
|
66242
66244
|
}
|
|
66243
|
-
var exprType = checkExpression(node.expression);
|
|
66244
66245
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
66245
66246
|
return exprType;
|
|
66246
66247
|
}
|
|
@@ -77596,8 +77597,8 @@ var ts;
|
|
|
77596
77597
|
_a[302] = function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
77597
77598
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
77598
77599
|
},
|
|
77599
|
-
_a[308] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
77600
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
77600
|
+
_a[308] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
77601
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
77601
77602
|
},
|
|
77602
77603
|
_a[353] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
77603
77604
|
return context.factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
@@ -104718,12 +104719,13 @@ var ts;
|
|
|
104718
104719
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
104719
104720
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
104720
104721
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
104721
|
-
|
|
104722
|
+
var compilerHost = {
|
|
104722
104723
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
104723
104724
|
var text;
|
|
104724
104725
|
try {
|
|
104725
104726
|
ts.performance.mark("beforeIORead");
|
|
104726
|
-
|
|
104727
|
+
var encoding = getCompilerOptions().charset;
|
|
104728
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
104727
104729
|
ts.performance.mark("afterIORead");
|
|
104728
104730
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
104729
104731
|
}
|
|
@@ -104754,6 +104756,7 @@ var ts;
|
|
|
104754
104756
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
104755
104757
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
104756
104758
|
};
|
|
104759
|
+
return compilerHost;
|
|
104757
104760
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
104758
104761
|
try {
|
|
104759
104762
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -104769,9 +104772,9 @@ var ts;
|
|
|
104769
104772
|
}
|
|
104770
104773
|
}
|
|
104771
104774
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
104772
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
104775
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
104773
104776
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
104774
|
-
var computeHash = ts.maybeBind(
|
|
104777
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
104775
104778
|
compilerHost.getSourceFile = function () {
|
|
104776
104779
|
var args = [];
|
|
104777
104780
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -104887,7 +104890,7 @@ var ts;
|
|
|
104887
104890
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
104888
104891
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
104889
104892
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
104890
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
104893
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
104891
104894
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
104892
104895
|
return host;
|
|
104893
104896
|
}
|
|
@@ -104972,7 +104975,7 @@ var ts;
|
|
|
104972
104975
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
104973
104976
|
}
|
|
104974
104977
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
104975
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
104978
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
104976
104979
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
104977
104980
|
compilerHost.getSourceFile = function (fileName) {
|
|
104978
104981
|
var args = [];
|
|
@@ -105092,8 +105095,8 @@ var ts;
|
|
|
105092
105095
|
}
|
|
105093
105096
|
}
|
|
105094
105097
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
105095
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
105096
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
105098
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
105099
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
105097
105100
|
if (hasChangedConfigFileParsingErrors) {
|
|
105098
105101
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
105099
105102
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -105218,9 +105221,14 @@ var ts;
|
|
|
105218
105221
|
}
|
|
105219
105222
|
}
|
|
105220
105223
|
}
|
|
105221
|
-
function getSourceVersion(path) {
|
|
105224
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
105222
105225
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
105223
|
-
|
|
105226
|
+
if (!hostSourceFile)
|
|
105227
|
+
return undefined;
|
|
105228
|
+
if (hostSourceFile.version)
|
|
105229
|
+
return hostSourceFile.version;
|
|
105230
|
+
var text = readFileWithCache(path);
|
|
105231
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
105224
105232
|
}
|
|
105225
105233
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
105226
105234
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -105652,7 +105660,7 @@ var ts;
|
|
|
105652
105660
|
var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
105653
105661
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
105654
105662
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
105655
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
105663
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
105656
105664
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
105657
105665
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
105658
105666
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -106634,7 +106642,7 @@ var ts;
|
|
|
106634
106642
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
106635
106643
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
106636
106644
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
106637
|
-
currentVersion = text
|
|
106645
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
106638
106646
|
if (version_3 && version_3 === currentVersion)
|
|
106639
106647
|
pseudoInputUpToDate = true;
|
|
106640
106648
|
}
|
package/lib/tsserver.js
CHANGED
|
@@ -109,7 +109,7 @@ var ts;
|
|
|
109
109
|
// The following is baselined as a literal template type without intervention
|
|
110
110
|
/** The version of the TypeScript compiler release */
|
|
111
111
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
112
|
-
ts.version = "".concat(ts.versionMajorMinor, ".
|
|
112
|
+
ts.version = "".concat(ts.versionMajorMinor, ".4");
|
|
113
113
|
/* @internal */
|
|
114
114
|
var Comparison;
|
|
115
115
|
(function (Comparison) {
|
|
@@ -68904,7 +68904,10 @@ var ts;
|
|
|
68904
68904
|
return !!(type.flags & 109440 /* TypeFlags.Unit */);
|
|
68905
68905
|
}
|
|
68906
68906
|
function isUnitLikeType(type) {
|
|
68907
|
-
|
|
68907
|
+
// Intersections that reduce to 'never' (e.g. 'T & null' where 'T extends {}') are not unit types.
|
|
68908
|
+
var t = getBaseConstraintOrType(type);
|
|
68909
|
+
// Scan intersections such that tagged literal types are considered unit types.
|
|
68910
|
+
return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
68908
68911
|
}
|
|
68909
68912
|
function extractUnitType(type) {
|
|
68910
68913
|
return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -79084,11 +79087,11 @@ var ts;
|
|
|
79084
79087
|
}
|
|
79085
79088
|
function checkSatisfiesExpression(node) {
|
|
79086
79089
|
checkSourceElement(node.type);
|
|
79090
|
+
var exprType = checkExpression(node.expression);
|
|
79087
79091
|
var targetType = getTypeFromTypeNode(node.type);
|
|
79088
79092
|
if (isErrorType(targetType)) {
|
|
79089
79093
|
return targetType;
|
|
79090
79094
|
}
|
|
79091
|
-
var exprType = checkExpression(node.expression);
|
|
79092
79095
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
79093
79096
|
return exprType;
|
|
79094
79097
|
}
|
|
@@ -91973,8 +91976,8 @@ var ts;
|
|
|
91973
91976
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91974
91977
|
},
|
|
91975
91978
|
// Top-level nodes
|
|
91976
|
-
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
91977
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
91979
|
+
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91980
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
91978
91981
|
},
|
|
91979
91982
|
// Transformation nodes
|
|
91980
91983
|
_a[353 /* SyntaxKind.PartiallyEmittedExpression */] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -126211,12 +126214,13 @@ var ts;
|
|
|
126211
126214
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
126212
126215
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
126213
126216
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
126214
|
-
|
|
126217
|
+
var compilerHost = {
|
|
126215
126218
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
126216
126219
|
var text;
|
|
126217
126220
|
try {
|
|
126218
126221
|
ts.performance.mark("beforeIORead");
|
|
126219
|
-
|
|
126222
|
+
var encoding = getCompilerOptions().charset;
|
|
126223
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
126220
126224
|
ts.performance.mark("afterIORead");
|
|
126221
126225
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
126222
126226
|
}
|
|
@@ -126247,6 +126251,7 @@ var ts;
|
|
|
126247
126251
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
126248
126252
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
126249
126253
|
};
|
|
126254
|
+
return compilerHost;
|
|
126250
126255
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
126251
126256
|
try {
|
|
126252
126257
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -126265,9 +126270,9 @@ var ts;
|
|
|
126265
126270
|
}
|
|
126266
126271
|
}
|
|
126267
126272
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
126268
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
126273
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
126269
126274
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
126270
|
-
var computeHash = ts.maybeBind(
|
|
126275
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
126271
126276
|
compilerHost.getSourceFile = function () {
|
|
126272
126277
|
var args = [];
|
|
126273
126278
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -126399,7 +126404,7 @@ var ts;
|
|
|
126399
126404
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
126400
126405
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
126401
126406
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
126402
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
126407
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
126403
126408
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
126404
126409
|
return host;
|
|
126405
126410
|
}
|
|
@@ -126485,7 +126490,7 @@ var ts;
|
|
|
126485
126490
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
126486
126491
|
}
|
|
126487
126492
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
126488
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
126493
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
126489
126494
|
// Members for CompilerHost
|
|
126490
126495
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
126491
126496
|
compilerHost.getSourceFile = function (fileName) {
|
|
@@ -126613,8 +126618,8 @@ var ts;
|
|
|
126613
126618
|
}
|
|
126614
126619
|
}
|
|
126615
126620
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126616
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126617
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126621
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
126622
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126618
126623
|
if (hasChangedConfigFileParsingErrors) {
|
|
126619
126624
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126620
126625
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126753,9 +126758,15 @@ var ts;
|
|
|
126753
126758
|
}
|
|
126754
126759
|
}
|
|
126755
126760
|
}
|
|
126756
|
-
function getSourceVersion(path) {
|
|
126761
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
126757
126762
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
126758
|
-
|
|
126763
|
+
if (!hostSourceFile)
|
|
126764
|
+
return undefined;
|
|
126765
|
+
if (hostSourceFile.version)
|
|
126766
|
+
return hostSourceFile.version;
|
|
126767
|
+
// Read file and get new version
|
|
126768
|
+
var text = readFileWithCache(path);
|
|
126769
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
126759
126770
|
}
|
|
126760
126771
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
126761
126772
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -127249,7 +127260,7 @@ var ts;
|
|
|
127249
127260
|
// State of the solution
|
|
127250
127261
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
127251
127262
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
127252
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
127263
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
127253
127264
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
127254
127265
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
127255
127266
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -128282,7 +128293,7 @@ var ts;
|
|
|
128282
128293
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
128283
128294
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
128284
128295
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
128285
|
-
currentVersion = text
|
|
128296
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
128286
128297
|
if (version_3 && version_3 === currentVersion)
|
|
128287
128298
|
pseudoInputUpToDate = true;
|
|
128288
128299
|
}
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -108,7 +108,7 @@ var ts;
|
|
|
108
108
|
// The following is baselined as a literal template type without intervention
|
|
109
109
|
/** The version of the TypeScript compiler release */
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
111
|
-
ts.version = "".concat(ts.versionMajorMinor, ".
|
|
111
|
+
ts.version = "".concat(ts.versionMajorMinor, ".4");
|
|
112
112
|
/* @internal */
|
|
113
113
|
var Comparison;
|
|
114
114
|
(function (Comparison) {
|
|
@@ -68903,7 +68903,10 @@ var ts;
|
|
|
68903
68903
|
return !!(type.flags & 109440 /* TypeFlags.Unit */);
|
|
68904
68904
|
}
|
|
68905
68905
|
function isUnitLikeType(type) {
|
|
68906
|
-
|
|
68906
|
+
// Intersections that reduce to 'never' (e.g. 'T & null' where 'T extends {}') are not unit types.
|
|
68907
|
+
var t = getBaseConstraintOrType(type);
|
|
68908
|
+
// Scan intersections such that tagged literal types are considered unit types.
|
|
68909
|
+
return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
68907
68910
|
}
|
|
68908
68911
|
function extractUnitType(type) {
|
|
68909
68912
|
return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -79083,11 +79086,11 @@ var ts;
|
|
|
79083
79086
|
}
|
|
79084
79087
|
function checkSatisfiesExpression(node) {
|
|
79085
79088
|
checkSourceElement(node.type);
|
|
79089
|
+
var exprType = checkExpression(node.expression);
|
|
79086
79090
|
var targetType = getTypeFromTypeNode(node.type);
|
|
79087
79091
|
if (isErrorType(targetType)) {
|
|
79088
79092
|
return targetType;
|
|
79089
79093
|
}
|
|
79090
|
-
var exprType = checkExpression(node.expression);
|
|
79091
79094
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
79092
79095
|
return exprType;
|
|
79093
79096
|
}
|
|
@@ -91972,8 +91975,8 @@ var ts;
|
|
|
91972
91975
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91973
91976
|
},
|
|
91974
91977
|
// Top-level nodes
|
|
91975
|
-
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
91976
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
91978
|
+
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91979
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
91977
91980
|
},
|
|
91978
91981
|
// Transformation nodes
|
|
91979
91982
|
_a[353 /* SyntaxKind.PartiallyEmittedExpression */] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -126210,12 +126213,13 @@ var ts;
|
|
|
126210
126213
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
126211
126214
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
126212
126215
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
126213
|
-
|
|
126216
|
+
var compilerHost = {
|
|
126214
126217
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
126215
126218
|
var text;
|
|
126216
126219
|
try {
|
|
126217
126220
|
ts.performance.mark("beforeIORead");
|
|
126218
|
-
|
|
126221
|
+
var encoding = getCompilerOptions().charset;
|
|
126222
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
126219
126223
|
ts.performance.mark("afterIORead");
|
|
126220
126224
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
126221
126225
|
}
|
|
@@ -126246,6 +126250,7 @@ var ts;
|
|
|
126246
126250
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
126247
126251
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
126248
126252
|
};
|
|
126253
|
+
return compilerHost;
|
|
126249
126254
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
126250
126255
|
try {
|
|
126251
126256
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -126264,9 +126269,9 @@ var ts;
|
|
|
126264
126269
|
}
|
|
126265
126270
|
}
|
|
126266
126271
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
126267
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
126272
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
126268
126273
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
126269
|
-
var computeHash = ts.maybeBind(
|
|
126274
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
126270
126275
|
compilerHost.getSourceFile = function () {
|
|
126271
126276
|
var args = [];
|
|
126272
126277
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -126398,7 +126403,7 @@ var ts;
|
|
|
126398
126403
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
126399
126404
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
126400
126405
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
126401
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
126406
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
126402
126407
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
126403
126408
|
return host;
|
|
126404
126409
|
}
|
|
@@ -126484,7 +126489,7 @@ var ts;
|
|
|
126484
126489
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
126485
126490
|
}
|
|
126486
126491
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
126487
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
126492
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
126488
126493
|
// Members for CompilerHost
|
|
126489
126494
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
126490
126495
|
compilerHost.getSourceFile = function (fileName) {
|
|
@@ -126612,8 +126617,8 @@ var ts;
|
|
|
126612
126617
|
}
|
|
126613
126618
|
}
|
|
126614
126619
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126615
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126616
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126620
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
126621
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126617
126622
|
if (hasChangedConfigFileParsingErrors) {
|
|
126618
126623
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126619
126624
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126752,9 +126757,15 @@ var ts;
|
|
|
126752
126757
|
}
|
|
126753
126758
|
}
|
|
126754
126759
|
}
|
|
126755
|
-
function getSourceVersion(path) {
|
|
126760
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
126756
126761
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
126757
|
-
|
|
126762
|
+
if (!hostSourceFile)
|
|
126763
|
+
return undefined;
|
|
126764
|
+
if (hostSourceFile.version)
|
|
126765
|
+
return hostSourceFile.version;
|
|
126766
|
+
// Read file and get new version
|
|
126767
|
+
var text = readFileWithCache(path);
|
|
126768
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
126758
126769
|
}
|
|
126759
126770
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
126760
126771
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -127248,7 +127259,7 @@ var ts;
|
|
|
127248
127259
|
// State of the solution
|
|
127249
127260
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
127250
127261
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
127251
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
127262
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
127252
127263
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
127253
127264
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
127254
127265
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -128281,7 +128292,7 @@ var ts;
|
|
|
128281
128292
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
128282
128293
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
128283
128294
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
128284
|
-
currentVersion = text
|
|
128295
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
128285
128296
|
if (version_3 && version_3 === currentVersion)
|
|
128286
128297
|
pseudoInputUpToDate = true;
|
|
128287
128298
|
}
|
package/lib/typescript.js
CHANGED
|
@@ -99,7 +99,7 @@ var ts;
|
|
|
99
99
|
// The following is baselined as a literal template type without intervention
|
|
100
100
|
/** The version of the TypeScript compiler release */
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
102
|
-
ts.version = "".concat(ts.versionMajorMinor, ".
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".4");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -68894,7 +68894,10 @@ var ts;
|
|
|
68894
68894
|
return !!(type.flags & 109440 /* TypeFlags.Unit */);
|
|
68895
68895
|
}
|
|
68896
68896
|
function isUnitLikeType(type) {
|
|
68897
|
-
|
|
68897
|
+
// Intersections that reduce to 'never' (e.g. 'T & null' where 'T extends {}') are not unit types.
|
|
68898
|
+
var t = getBaseConstraintOrType(type);
|
|
68899
|
+
// Scan intersections such that tagged literal types are considered unit types.
|
|
68900
|
+
return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
68898
68901
|
}
|
|
68899
68902
|
function extractUnitType(type) {
|
|
68900
68903
|
return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -79074,11 +79077,11 @@ var ts;
|
|
|
79074
79077
|
}
|
|
79075
79078
|
function checkSatisfiesExpression(node) {
|
|
79076
79079
|
checkSourceElement(node.type);
|
|
79080
|
+
var exprType = checkExpression(node.expression);
|
|
79077
79081
|
var targetType = getTypeFromTypeNode(node.type);
|
|
79078
79082
|
if (isErrorType(targetType)) {
|
|
79079
79083
|
return targetType;
|
|
79080
79084
|
}
|
|
79081
|
-
var exprType = checkExpression(node.expression);
|
|
79082
79085
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
79083
79086
|
return exprType;
|
|
79084
79087
|
}
|
|
@@ -91963,8 +91966,8 @@ var ts;
|
|
|
91963
91966
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91964
91967
|
},
|
|
91965
91968
|
// Top-level nodes
|
|
91966
|
-
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
91967
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
91969
|
+
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91970
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
91968
91971
|
},
|
|
91969
91972
|
// Transformation nodes
|
|
91970
91973
|
_a[353 /* SyntaxKind.PartiallyEmittedExpression */] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -126201,12 +126204,13 @@ var ts;
|
|
|
126201
126204
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
126202
126205
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
126203
126206
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
126204
|
-
|
|
126207
|
+
var compilerHost = {
|
|
126205
126208
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
126206
126209
|
var text;
|
|
126207
126210
|
try {
|
|
126208
126211
|
ts.performance.mark("beforeIORead");
|
|
126209
|
-
|
|
126212
|
+
var encoding = getCompilerOptions().charset;
|
|
126213
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
126210
126214
|
ts.performance.mark("afterIORead");
|
|
126211
126215
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
126212
126216
|
}
|
|
@@ -126237,6 +126241,7 @@ var ts;
|
|
|
126237
126241
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
126238
126242
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
126239
126243
|
};
|
|
126244
|
+
return compilerHost;
|
|
126240
126245
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
126241
126246
|
try {
|
|
126242
126247
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -126255,9 +126260,9 @@ var ts;
|
|
|
126255
126260
|
}
|
|
126256
126261
|
}
|
|
126257
126262
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
126258
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
126263
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
126259
126264
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
126260
|
-
var computeHash = ts.maybeBind(
|
|
126265
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
126261
126266
|
compilerHost.getSourceFile = function () {
|
|
126262
126267
|
var args = [];
|
|
126263
126268
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -126389,7 +126394,7 @@ var ts;
|
|
|
126389
126394
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
126390
126395
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
126391
126396
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
126392
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
126397
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
126393
126398
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
126394
126399
|
return host;
|
|
126395
126400
|
}
|
|
@@ -126475,7 +126480,7 @@ var ts;
|
|
|
126475
126480
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
126476
126481
|
}
|
|
126477
126482
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
126478
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
126483
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
126479
126484
|
// Members for CompilerHost
|
|
126480
126485
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
126481
126486
|
compilerHost.getSourceFile = function (fileName) {
|
|
@@ -126603,8 +126608,8 @@ var ts;
|
|
|
126603
126608
|
}
|
|
126604
126609
|
}
|
|
126605
126610
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126606
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126607
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126611
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
126612
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126608
126613
|
if (hasChangedConfigFileParsingErrors) {
|
|
126609
126614
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126610
126615
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126743,9 +126748,15 @@ var ts;
|
|
|
126743
126748
|
}
|
|
126744
126749
|
}
|
|
126745
126750
|
}
|
|
126746
|
-
function getSourceVersion(path) {
|
|
126751
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
126747
126752
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
126748
|
-
|
|
126753
|
+
if (!hostSourceFile)
|
|
126754
|
+
return undefined;
|
|
126755
|
+
if (hostSourceFile.version)
|
|
126756
|
+
return hostSourceFile.version;
|
|
126757
|
+
// Read file and get new version
|
|
126758
|
+
var text = readFileWithCache(path);
|
|
126759
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
126749
126760
|
}
|
|
126750
126761
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
126751
126762
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -127239,7 +127250,7 @@ var ts;
|
|
|
127239
127250
|
// State of the solution
|
|
127240
127251
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
127241
127252
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
127242
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
127253
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
127243
127254
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
127244
127255
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
127245
127256
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -128272,7 +128283,7 @@ var ts;
|
|
|
128272
128283
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
128273
128284
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
128274
128285
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
128275
|
-
currentVersion = text
|
|
128286
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
128276
128287
|
if (version_3 && version_3 === currentVersion)
|
|
128277
128288
|
pseudoInputUpToDate = true;
|
|
128278
128289
|
}
|
|
@@ -99,7 +99,7 @@ var ts;
|
|
|
99
99
|
// The following is baselined as a literal template type without intervention
|
|
100
100
|
/** The version of the TypeScript compiler release */
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
102
|
-
ts.version = "".concat(ts.versionMajorMinor, ".
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".4");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -68894,7 +68894,10 @@ var ts;
|
|
|
68894
68894
|
return !!(type.flags & 109440 /* TypeFlags.Unit */);
|
|
68895
68895
|
}
|
|
68896
68896
|
function isUnitLikeType(type) {
|
|
68897
|
-
|
|
68897
|
+
// Intersections that reduce to 'never' (e.g. 'T & null' where 'T extends {}') are not unit types.
|
|
68898
|
+
var t = getBaseConstraintOrType(type);
|
|
68899
|
+
// Scan intersections such that tagged literal types are considered unit types.
|
|
68900
|
+
return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
68898
68901
|
}
|
|
68899
68902
|
function extractUnitType(type) {
|
|
68900
68903
|
return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -79074,11 +79077,11 @@ var ts;
|
|
|
79074
79077
|
}
|
|
79075
79078
|
function checkSatisfiesExpression(node) {
|
|
79076
79079
|
checkSourceElement(node.type);
|
|
79080
|
+
var exprType = checkExpression(node.expression);
|
|
79077
79081
|
var targetType = getTypeFromTypeNode(node.type);
|
|
79078
79082
|
if (isErrorType(targetType)) {
|
|
79079
79083
|
return targetType;
|
|
79080
79084
|
}
|
|
79081
|
-
var exprType = checkExpression(node.expression);
|
|
79082
79085
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
79083
79086
|
return exprType;
|
|
79084
79087
|
}
|
|
@@ -91963,8 +91966,8 @@ var ts;
|
|
|
91963
91966
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91964
91967
|
},
|
|
91965
91968
|
// Top-level nodes
|
|
91966
|
-
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
91967
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
91969
|
+
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91970
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
91968
91971
|
},
|
|
91969
91972
|
// Transformation nodes
|
|
91970
91973
|
_a[353 /* SyntaxKind.PartiallyEmittedExpression */] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -126201,12 +126204,13 @@ var ts;
|
|
|
126201
126204
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
126202
126205
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
126203
126206
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
126204
|
-
|
|
126207
|
+
var compilerHost = {
|
|
126205
126208
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
126206
126209
|
var text;
|
|
126207
126210
|
try {
|
|
126208
126211
|
ts.performance.mark("beforeIORead");
|
|
126209
|
-
|
|
126212
|
+
var encoding = getCompilerOptions().charset;
|
|
126213
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
126210
126214
|
ts.performance.mark("afterIORead");
|
|
126211
126215
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
126212
126216
|
}
|
|
@@ -126237,6 +126241,7 @@ var ts;
|
|
|
126237
126241
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
126238
126242
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
126239
126243
|
};
|
|
126244
|
+
return compilerHost;
|
|
126240
126245
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
126241
126246
|
try {
|
|
126242
126247
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -126255,9 +126260,9 @@ var ts;
|
|
|
126255
126260
|
}
|
|
126256
126261
|
}
|
|
126257
126262
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
126258
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
126263
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
126259
126264
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
126260
|
-
var computeHash = ts.maybeBind(
|
|
126265
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
126261
126266
|
compilerHost.getSourceFile = function () {
|
|
126262
126267
|
var args = [];
|
|
126263
126268
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -126389,7 +126394,7 @@ var ts;
|
|
|
126389
126394
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
126390
126395
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
126391
126396
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
126392
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
126397
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
126393
126398
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
126394
126399
|
return host;
|
|
126395
126400
|
}
|
|
@@ -126475,7 +126480,7 @@ var ts;
|
|
|
126475
126480
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
126476
126481
|
}
|
|
126477
126482
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
126478
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
126483
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
126479
126484
|
// Members for CompilerHost
|
|
126480
126485
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
126481
126486
|
compilerHost.getSourceFile = function (fileName) {
|
|
@@ -126603,8 +126608,8 @@ var ts;
|
|
|
126603
126608
|
}
|
|
126604
126609
|
}
|
|
126605
126610
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126606
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126607
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126611
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
126612
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126608
126613
|
if (hasChangedConfigFileParsingErrors) {
|
|
126609
126614
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126610
126615
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126743,9 +126748,15 @@ var ts;
|
|
|
126743
126748
|
}
|
|
126744
126749
|
}
|
|
126745
126750
|
}
|
|
126746
|
-
function getSourceVersion(path) {
|
|
126751
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
126747
126752
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
126748
|
-
|
|
126753
|
+
if (!hostSourceFile)
|
|
126754
|
+
return undefined;
|
|
126755
|
+
if (hostSourceFile.version)
|
|
126756
|
+
return hostSourceFile.version;
|
|
126757
|
+
// Read file and get new version
|
|
126758
|
+
var text = readFileWithCache(path);
|
|
126759
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
126749
126760
|
}
|
|
126750
126761
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
126751
126762
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -127239,7 +127250,7 @@ var ts;
|
|
|
127239
127250
|
// State of the solution
|
|
127240
127251
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
127241
127252
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
127242
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
127253
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
127243
127254
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
127244
127255
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
127245
127256
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -128272,7 +128283,7 @@ var ts;
|
|
|
128272
128283
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
128273
128284
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
128274
128285
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
128275
|
-
currentVersion = text
|
|
128286
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
128276
128287
|
if (version_3 && version_3 === currentVersion)
|
|
128277
128288
|
pseudoInputUpToDate = true;
|
|
128278
128289
|
}
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = "".concat(ts.versionMajorMinor, ".
|
|
92
|
+
ts.version = "".concat(ts.versionMajorMinor, ".4");
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -68884,7 +68884,10 @@ var ts;
|
|
|
68884
68884
|
return !!(type.flags & 109440 /* TypeFlags.Unit */);
|
|
68885
68885
|
}
|
|
68886
68886
|
function isUnitLikeType(type) {
|
|
68887
|
-
|
|
68887
|
+
// Intersections that reduce to 'never' (e.g. 'T & null' where 'T extends {}') are not unit types.
|
|
68888
|
+
var t = getBaseConstraintOrType(type);
|
|
68889
|
+
// Scan intersections such that tagged literal types are considered unit types.
|
|
68890
|
+
return t.flags & 2097152 /* TypeFlags.Intersection */ ? ts.some(t.types, isUnitType) : isUnitType(t);
|
|
68888
68891
|
}
|
|
68889
68892
|
function extractUnitType(type) {
|
|
68890
68893
|
return type.flags & 2097152 /* TypeFlags.Intersection */ ? ts.find(type.types, isUnitType) || type : type;
|
|
@@ -79064,11 +79067,11 @@ var ts;
|
|
|
79064
79067
|
}
|
|
79065
79068
|
function checkSatisfiesExpression(node) {
|
|
79066
79069
|
checkSourceElement(node.type);
|
|
79070
|
+
var exprType = checkExpression(node.expression);
|
|
79067
79071
|
var targetType = getTypeFromTypeNode(node.type);
|
|
79068
79072
|
if (isErrorType(targetType)) {
|
|
79069
79073
|
return targetType;
|
|
79070
79074
|
}
|
|
79071
|
-
var exprType = checkExpression(node.expression);
|
|
79072
79075
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
79073
79076
|
return exprType;
|
|
79074
79077
|
}
|
|
@@ -91953,8 +91956,8 @@ var ts;
|
|
|
91953
91956
|
return context.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91954
91957
|
},
|
|
91955
91958
|
// Top-level nodes
|
|
91956
|
-
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context,
|
|
91957
|
-
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context
|
|
91959
|
+
_a[308 /* SyntaxKind.SourceFile */] = function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91960
|
+
return context.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context));
|
|
91958
91961
|
},
|
|
91959
91962
|
// Transformation nodes
|
|
91960
91963
|
_a[353 /* SyntaxKind.PartiallyEmittedExpression */] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -126191,12 +126194,13 @@ var ts;
|
|
|
126191
126194
|
if (directoryStructureHost === void 0) { directoryStructureHost = host; }
|
|
126192
126195
|
var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
|
|
126193
126196
|
var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
|
|
126194
|
-
|
|
126197
|
+
var compilerHost = {
|
|
126195
126198
|
getSourceFile: function (fileName, languageVersionOrOptions, onError) {
|
|
126196
126199
|
var text;
|
|
126197
126200
|
try {
|
|
126198
126201
|
ts.performance.mark("beforeIORead");
|
|
126199
|
-
|
|
126202
|
+
var encoding = getCompilerOptions().charset;
|
|
126203
|
+
text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding);
|
|
126200
126204
|
ts.performance.mark("afterIORead");
|
|
126201
126205
|
ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
|
|
126202
126206
|
}
|
|
@@ -126227,6 +126231,7 @@ var ts;
|
|
|
126227
126231
|
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
126228
126232
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
126229
126233
|
};
|
|
126234
|
+
return compilerHost;
|
|
126230
126235
|
function writeFile(fileName, text, writeByteOrderMark, onError) {
|
|
126231
126236
|
try {
|
|
126232
126237
|
ts.performance.mark("beforeIOWrite");
|
|
@@ -126245,9 +126250,9 @@ var ts;
|
|
|
126245
126250
|
}
|
|
126246
126251
|
}
|
|
126247
126252
|
ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
|
|
126248
|
-
function setGetSourceFileAsHashVersioned(compilerHost
|
|
126253
|
+
function setGetSourceFileAsHashVersioned(compilerHost) {
|
|
126249
126254
|
var originalGetSourceFile = compilerHost.getSourceFile;
|
|
126250
|
-
var computeHash = ts.maybeBind(
|
|
126255
|
+
var computeHash = ts.maybeBind(compilerHost, compilerHost.createHash) || ts.generateDjb2Hash;
|
|
126251
126256
|
compilerHost.getSourceFile = function () {
|
|
126252
126257
|
var args = [];
|
|
126253
126258
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -126379,7 +126384,7 @@ var ts;
|
|
|
126379
126384
|
host.createHash = ts.maybeBind(system, system.createHash);
|
|
126380
126385
|
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
126381
126386
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
126382
|
-
ts.setGetSourceFileAsHashVersioned(host
|
|
126387
|
+
ts.setGetSourceFileAsHashVersioned(host);
|
|
126383
126388
|
ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); });
|
|
126384
126389
|
return host;
|
|
126385
126390
|
}
|
|
@@ -126465,7 +126470,7 @@ var ts;
|
|
|
126465
126470
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
126466
126471
|
}
|
|
126467
126472
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return compilerOptions; }, directoryStructureHost);
|
|
126468
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
126473
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
126469
126474
|
// Members for CompilerHost
|
|
126470
126475
|
var getNewSourceFile = compilerHost.getSourceFile;
|
|
126471
126476
|
compilerHost.getSourceFile = function (fileName) {
|
|
@@ -126593,8 +126598,8 @@ var ts;
|
|
|
126593
126598
|
}
|
|
126594
126599
|
}
|
|
126595
126600
|
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126596
|
-
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126597
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126601
|
+
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile, readFileWithCache = _a.readFileWithCache;
|
|
126602
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function (path) { return getSourceVersion(path, readFileWithCache); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126598
126603
|
if (hasChangedConfigFileParsingErrors) {
|
|
126599
126604
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126600
126605
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126733,9 +126738,15 @@ var ts;
|
|
|
126733
126738
|
}
|
|
126734
126739
|
}
|
|
126735
126740
|
}
|
|
126736
|
-
function getSourceVersion(path) {
|
|
126741
|
+
function getSourceVersion(path, readFileWithCache) {
|
|
126737
126742
|
var hostSourceFile = sourceFilesCache.get(path);
|
|
126738
|
-
|
|
126743
|
+
if (!hostSourceFile)
|
|
126744
|
+
return undefined;
|
|
126745
|
+
if (hostSourceFile.version)
|
|
126746
|
+
return hostSourceFile.version;
|
|
126747
|
+
// Read file and get new version
|
|
126748
|
+
var text = readFileWithCache(path);
|
|
126749
|
+
return text !== undefined ? (compilerHost.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
126739
126750
|
}
|
|
126740
126751
|
function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) {
|
|
126741
126752
|
var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath);
|
|
@@ -127229,7 +127240,7 @@ var ts;
|
|
|
127229
127240
|
// State of the solution
|
|
127230
127241
|
var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
127231
127242
|
var compilerHost = ts.createCompilerHostFromProgramHost(host, function () { return state.projectCompilerOptions; });
|
|
127232
|
-
ts.setGetSourceFileAsHashVersioned(compilerHost
|
|
127243
|
+
ts.setGetSourceFileAsHashVersioned(compilerHost);
|
|
127233
127244
|
compilerHost.getParsedCommandLine = function (fileName) { return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); };
|
|
127234
127245
|
compilerHost.resolveModuleNames = ts.maybeBind(host, host.resolveModuleNames);
|
|
127235
127246
|
compilerHost.resolveTypeReferenceDirectives = ts.maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
@@ -128262,7 +128273,7 @@ var ts;
|
|
|
128262
128273
|
buildInfoVersionMap = ts.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
128263
128274
|
version_3 = buildInfoVersionMap.get(toPath(state, inputFile));
|
|
128264
128275
|
var text = version_3 ? state.readFileWithCache(inputFile) : undefined;
|
|
128265
|
-
currentVersion = text
|
|
128276
|
+
currentVersion = text !== undefined ? (host.createHash || ts.generateDjb2Hash)(text) : undefined;
|
|
128266
128277
|
if (version_3 && version_3 === currentVersion)
|
|
128267
128278
|
pseudoInputUpToDate = true;
|
|
128268
128279
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.9.
|
|
5
|
+
"version": "4.9.4",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|