typescript 4.7.0-dev.20220418 → 4.7.0-dev.20220421
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 +93 -75
- package/lib/tsserver.js +117 -92
- package/lib/tsserverlibrary.js +117 -92
- package/lib/typescript.js +117 -92
- package/lib/typescriptServices.js +117 -92
- package/lib/typingsInstaller.js +117 -92
- package/package.json +1 -1
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 = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220421";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -33175,7 +33175,8 @@ var ts;
|
|
|
33175
33175
|
var pos = getNodePos();
|
|
33176
33176
|
parseExpected(112 /* TypeOfKeyword */);
|
|
33177
33177
|
var entityName = parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ true);
|
|
33178
|
-
|
|
33178
|
+
// Make sure we perform ASI to prevent parsing the next line's type arguments as part of an instantiation expression.
|
|
33179
|
+
var typeArguments = !scanner.hasPrecedingLineBreak() ? tryParseTypeArguments() : undefined;
|
|
33179
33180
|
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
33180
33181
|
}
|
|
33181
33182
|
function parseTypeParameter() {
|
|
@@ -61923,11 +61924,14 @@ var ts;
|
|
|
61923
61924
|
return type[cache] = elementType;
|
|
61924
61925
|
}
|
|
61925
61926
|
}
|
|
61926
|
-
// If the object type is a mapped type { [P in K]: E }, where K is generic,
|
|
61927
|
-
//
|
|
61928
|
-
// construct the type Box<T[X]>.
|
|
61929
|
-
if (isGenericMappedType(objectType)
|
|
61930
|
-
|
|
61927
|
+
// If the object type is a mapped type { [P in K]: E }, where K is generic, or { [P in K as N]: E }, where
|
|
61928
|
+
// K is generic and N is assignable to P, instantiate E using a mapper that substitutes the index type for P.
|
|
61929
|
+
// For example, for an index access { [P in K]: Box<T[P]> }[X], we construct the type Box<T[X]>.
|
|
61930
|
+
if (isGenericMappedType(objectType)) {
|
|
61931
|
+
var nameType = getNameTypeFromMappedType(objectType);
|
|
61932
|
+
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
61933
|
+
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), function (t) { return getSimplifiedType(t, writing); });
|
|
61934
|
+
}
|
|
61931
61935
|
}
|
|
61932
61936
|
return type[cache] = type;
|
|
61933
61937
|
}
|
|
@@ -74247,10 +74251,15 @@ var ts;
|
|
|
74247
74251
|
prop = getPropertyOfType(apparentType, right.escapedText);
|
|
74248
74252
|
}
|
|
74249
74253
|
// In `Foo.Bar.Baz`, 'Foo' is not referenced if 'Bar' is a const enum or a module containing only const enums.
|
|
74254
|
+
// `Foo` is also not referenced in `enum FooCopy { Bar = Foo.Bar }`, because the enum member value gets inlined
|
|
74255
|
+
// here even if `Foo` is not a const enum.
|
|
74256
|
+
//
|
|
74250
74257
|
// The exceptions are:
|
|
74251
74258
|
// 1. if 'isolatedModules' is enabled, because the const enum value will not be inlined, and
|
|
74252
74259
|
// 2. if 'preserveConstEnums' is enabled and the expression is itself an export, e.g. `export = Foo.Bar.Baz`.
|
|
74253
|
-
if (ts.isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules ||
|
|
74260
|
+
if (ts.isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules ||
|
|
74261
|
+
!(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 /* EnumMember */ && node.parent.kind === 299 /* EnumMember */)) ||
|
|
74262
|
+
ts.shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) {
|
|
74254
74263
|
markAliasReferenced(parentSymbol, node);
|
|
74255
74264
|
}
|
|
74256
74265
|
var propType;
|
|
@@ -85985,15 +85994,20 @@ var ts;
|
|
|
85985
85994
|
return propertyDeclaration;
|
|
85986
85995
|
}
|
|
85987
85996
|
}
|
|
85988
|
-
else if (ts.isMetaProperty(parent)) {
|
|
85989
|
-
|
|
85990
|
-
|
|
85991
|
-
if (propertyDeclaration) {
|
|
85992
|
-
return propertyDeclaration;
|
|
85993
|
-
}
|
|
85994
|
-
if (parent.keywordToken === 103 /* NewKeyword */) {
|
|
85997
|
+
else if (ts.isMetaProperty(parent) && parent.name === node) {
|
|
85998
|
+
if (parent.keywordToken === 103 /* NewKeyword */ && ts.idText(node) === "target") {
|
|
85999
|
+
// `target` in `new.target`
|
|
85995
86000
|
return checkNewTargetMetaProperty(parent).symbol;
|
|
85996
86001
|
}
|
|
86002
|
+
// The `meta` in `import.meta` could be given `getTypeOfNode(parent).symbol` (the `ImportMeta` interface symbol), but
|
|
86003
|
+
// we have a fake expression type made for other reasons already, whose transient `meta`
|
|
86004
|
+
// member should more exactly be the kind of (declarationless) symbol we want.
|
|
86005
|
+
// (See #44364 and #45031 for relevant implementation PRs)
|
|
86006
|
+
if (parent.keywordToken === 100 /* ImportKeyword */ && ts.idText(node) === "meta") {
|
|
86007
|
+
return getGlobalImportMetaExpressionType().members.get("meta");
|
|
86008
|
+
}
|
|
86009
|
+
// no other meta properties are valid syntax, thus no others should have symbols
|
|
86010
|
+
return undefined;
|
|
85997
86011
|
}
|
|
85998
86012
|
}
|
|
85999
86013
|
switch (node.kind) {
|
|
@@ -94671,7 +94685,7 @@ var ts;
|
|
|
94671
94685
|
}
|
|
94672
94686
|
resumeLexicalEnvironment();
|
|
94673
94687
|
var needsSyntheticConstructor = !constructor && isDerivedClass;
|
|
94674
|
-
var
|
|
94688
|
+
var indexOfFirstStatementAfterSuperAndPrologue = 0;
|
|
94675
94689
|
var prologueStatementCount = 0;
|
|
94676
94690
|
var superStatementIndex = -1;
|
|
94677
94691
|
var statements = [];
|
|
@@ -94680,8 +94694,11 @@ var ts;
|
|
|
94680
94694
|
superStatementIndex = ts.findSuperStatementIndex(constructor.body.statements, prologueStatementCount);
|
|
94681
94695
|
// If there was a super call, visit existing statements up to and including it
|
|
94682
94696
|
if (superStatementIndex >= 0) {
|
|
94683
|
-
|
|
94684
|
-
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, prologueStatementCount), true), ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, prologueStatementCount,
|
|
94697
|
+
indexOfFirstStatementAfterSuperAndPrologue = superStatementIndex + 1;
|
|
94698
|
+
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, prologueStatementCount), true), ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, prologueStatementCount, indexOfFirstStatementAfterSuperAndPrologue - prologueStatementCount), true), statements.slice(prologueStatementCount), true);
|
|
94699
|
+
}
|
|
94700
|
+
else if (prologueStatementCount >= 0) {
|
|
94701
|
+
indexOfFirstStatementAfterSuperAndPrologue = prologueStatementCount;
|
|
94685
94702
|
}
|
|
94686
94703
|
}
|
|
94687
94704
|
if (needsSyntheticConstructor) {
|
|
@@ -94717,22 +94734,20 @@ var ts;
|
|
|
94717
94734
|
}
|
|
94718
94735
|
}
|
|
94719
94736
|
if (parameterPropertyDeclarationCount > 0) {
|
|
94720
|
-
var parameterProperties = ts.visitNodes(constructor.body.statements, visitor, ts.isStatement,
|
|
94737
|
+
var parameterProperties = ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatementAfterSuperAndPrologue, parameterPropertyDeclarationCount);
|
|
94721
94738
|
// If there was a super() call found, add parameter properties immediately after it
|
|
94722
94739
|
if (superStatementIndex >= 0) {
|
|
94723
94740
|
ts.addRange(statements, parameterProperties);
|
|
94724
94741
|
}
|
|
94725
|
-
// If a synthetic super() call was added, add them just after it
|
|
94726
|
-
else if (needsSyntheticConstructor) {
|
|
94727
|
-
statements = __spreadArray(__spreadArray([
|
|
94728
|
-
statements[0]
|
|
94729
|
-
], parameterProperties, true), statements.slice(1), true);
|
|
94730
|
-
}
|
|
94731
|
-
// Since there wasn't a super() call, add them to the top of the constructor
|
|
94732
94742
|
else {
|
|
94733
|
-
|
|
94743
|
+
// Add add parameter properties to the top of the constructor after the prologue
|
|
94744
|
+
var superAndPrologueStatementCount = prologueStatementCount;
|
|
94745
|
+
// If a synthetic super() call was added, need to account for that
|
|
94746
|
+
if (needsSyntheticConstructor)
|
|
94747
|
+
superAndPrologueStatementCount++;
|
|
94748
|
+
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, superAndPrologueStatementCount), true), parameterProperties, true), statements.slice(superAndPrologueStatementCount), true);
|
|
94734
94749
|
}
|
|
94735
|
-
|
|
94750
|
+
indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount;
|
|
94736
94751
|
}
|
|
94737
94752
|
}
|
|
94738
94753
|
}
|
|
@@ -94742,7 +94757,7 @@ var ts;
|
|
|
94742
94757
|
addPropertyOrClassStaticBlockStatements(statements, properties, receiver);
|
|
94743
94758
|
// Add existing statements after the initial prologues and super call
|
|
94744
94759
|
if (constructor) {
|
|
94745
|
-
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitBodyStatement, ts.isStatement,
|
|
94760
|
+
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitBodyStatement, ts.isStatement, indexOfFirstStatementAfterSuperAndPrologue));
|
|
94746
94761
|
}
|
|
94747
94762
|
statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
|
|
94748
94763
|
return ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements),
|
|
@@ -98783,7 +98798,7 @@ var ts;
|
|
|
98783
98798
|
// ```
|
|
98784
98799
|
insertCaptureThisForNodeIfNeeded(prologue, constructor);
|
|
98785
98800
|
}
|
|
98786
|
-
var body = factory.createBlock(ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], existingPrologue, true), prologue, true), (superStatementIndex <= existingPrologue.length ? ts.emptyArray : ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, existingPrologue.length, superStatementIndex)), true), statements, true)),
|
|
98801
|
+
var body = factory.createBlock(ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], existingPrologue, true), prologue, true), (superStatementIndex <= existingPrologue.length ? ts.emptyArray : ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, existingPrologue.length, superStatementIndex - existingPrologue.length)), true), statements, true)),
|
|
98787
98802
|
/*location*/ constructor.body.statements),
|
|
98788
98803
|
/*multiLine*/ true);
|
|
98789
98804
|
ts.setTextRange(body, constructor.body);
|
|
@@ -119759,6 +119774,18 @@ var ts;
|
|
|
119759
119774
|
}
|
|
119760
119775
|
return undefined;
|
|
119761
119776
|
}
|
|
119777
|
+
function removeDiagnosticsOfLibraryFiles(state) {
|
|
119778
|
+
if (!state.cleanedDiagnosticsOfLibFiles) {
|
|
119779
|
+
state.cleanedDiagnosticsOfLibFiles = true;
|
|
119780
|
+
var program_1 = ts.Debug.checkDefined(state.program);
|
|
119781
|
+
var options_2 = program_1.getCompilerOptions();
|
|
119782
|
+
ts.forEach(program_1.getSourceFiles(), function (f) {
|
|
119783
|
+
return program_1.isSourceFileDefaultLibrary(f) &&
|
|
119784
|
+
!ts.skipTypeChecking(f, options_2, program_1) &&
|
|
119785
|
+
removeSemanticDiagnosticsOf(state, f.resolvedPath);
|
|
119786
|
+
});
|
|
119787
|
+
}
|
|
119788
|
+
}
|
|
119762
119789
|
/**
|
|
119763
119790
|
* Handles semantic diagnostics and dts emit for affectedFile and files, that are referencing modules that export entities from affected file
|
|
119764
119791
|
* This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
|
|
@@ -119768,28 +119795,17 @@ var ts;
|
|
|
119768
119795
|
removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath);
|
|
119769
119796
|
// If affected files is everything except default library, then nothing more to do
|
|
119770
119797
|
if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) {
|
|
119771
|
-
|
|
119772
|
-
state.cleanedDiagnosticsOfLibFiles = true;
|
|
119773
|
-
var program_1 = ts.Debug.checkDefined(state.program);
|
|
119774
|
-
var options_2 = program_1.getCompilerOptions();
|
|
119775
|
-
ts.forEach(program_1.getSourceFiles(), function (f) {
|
|
119776
|
-
return program_1.isSourceFileDefaultLibrary(f) &&
|
|
119777
|
-
!ts.skipTypeChecking(f, options_2, program_1) &&
|
|
119778
|
-
removeSemanticDiagnosticsOf(state, f.resolvedPath);
|
|
119779
|
-
});
|
|
119780
|
-
}
|
|
119798
|
+
removeDiagnosticsOfLibraryFiles(state);
|
|
119781
119799
|
// When a change affects the global scope, all files are considered to be affected without updating their signature
|
|
119782
119800
|
// That means when affected file is handled, its signature can be out of date
|
|
119783
119801
|
// To avoid this, ensure that we update the signature for any affected file in this scenario.
|
|
119784
119802
|
ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap);
|
|
119785
119803
|
return;
|
|
119786
119804
|
}
|
|
119787
|
-
|
|
119788
|
-
|
|
119789
|
-
|
|
119790
|
-
|
|
119791
|
-
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash, host); });
|
|
119792
|
-
}
|
|
119805
|
+
ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: " + affectedFile.fileName);
|
|
119806
|
+
if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies)
|
|
119807
|
+
return;
|
|
119808
|
+
handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host);
|
|
119793
119809
|
}
|
|
119794
119810
|
/**
|
|
119795
119811
|
* Handle the dts may change, so they need to be added to pending emit if dts emit is enabled,
|
|
@@ -119831,16 +119847,41 @@ var ts;
|
|
|
119831
119847
|
var oldSignature = ts.Debug.checkDefined(state.fileInfos.get(path)).signature;
|
|
119832
119848
|
return newSignature !== oldSignature;
|
|
119833
119849
|
}
|
|
119850
|
+
function forEachKeyOfExportedModulesMap(state, filePath, fn) {
|
|
119851
|
+
// Go through exported modules from cache first
|
|
119852
|
+
var keys = state.currentAffectedFilesExportedModulesMap.getKeys(filePath);
|
|
119853
|
+
var result = keys && ts.forEachKey(keys, fn);
|
|
119854
|
+
if (result)
|
|
119855
|
+
return result;
|
|
119856
|
+
// If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
|
|
119857
|
+
keys = state.exportedModulesMap.getKeys(filePath);
|
|
119858
|
+
return keys && ts.forEachKey(keys, function (exportedFromPath) {
|
|
119859
|
+
var _a;
|
|
119860
|
+
// If the cache had an updated value, skip
|
|
119861
|
+
return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
|
|
119862
|
+
!((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) ?
|
|
119863
|
+
fn(exportedFromPath) :
|
|
119864
|
+
undefined;
|
|
119865
|
+
});
|
|
119866
|
+
}
|
|
119867
|
+
function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host) {
|
|
119868
|
+
var _a;
|
|
119869
|
+
if (!((_a = state.fileInfos.get(filePath)) === null || _a === void 0 ? void 0 : _a.affectsGlobalScope))
|
|
119870
|
+
return false;
|
|
119871
|
+
// Every file needs to be handled
|
|
119872
|
+
ts.BuilderState.getAllFilesExcludingDefaultLibraryFile(state, state.program, /*firstSourceFile*/ undefined)
|
|
119873
|
+
.forEach(function (file) { return handleDtsMayChangeOf(state, file.resolvedPath, cancellationToken, computeHash, host); });
|
|
119874
|
+
removeDiagnosticsOfLibraryFiles(state);
|
|
119875
|
+
return true;
|
|
119876
|
+
}
|
|
119834
119877
|
/**
|
|
119835
|
-
* Iterate on referencing modules that export entities from affected file
|
|
119878
|
+
* Iterate on referencing modules that export entities from affected file and delete diagnostics and add pending emit
|
|
119836
119879
|
*/
|
|
119837
|
-
function
|
|
119838
|
-
var _a, _b;
|
|
119880
|
+
function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) {
|
|
119839
119881
|
// If there was change in signature (dts output) for the changed file,
|
|
119840
119882
|
// then only we need to handle pending file emit
|
|
119841
|
-
if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
|
|
119883
|
+
if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath))
|
|
119842
119884
|
return;
|
|
119843
|
-
}
|
|
119844
119885
|
if (!isChangedSignature(state, affectedFile.resolvedPath))
|
|
119845
119886
|
return;
|
|
119846
119887
|
// Since isolated modules dont change js files, files affected by change in signature is itself
|
|
@@ -119853,7 +119894,9 @@ var ts;
|
|
|
119853
119894
|
var currentPath = queue.pop();
|
|
119854
119895
|
if (!seenFileNamesMap.has(currentPath)) {
|
|
119855
119896
|
seenFileNamesMap.set(currentPath, true);
|
|
119856
|
-
|
|
119897
|
+
if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, computeHash, host))
|
|
119898
|
+
return;
|
|
119899
|
+
handleDtsMayChangeOf(state, currentPath, cancellationToken, computeHash, host);
|
|
119857
119900
|
if (isChangedSignature(state, currentPath)) {
|
|
119858
119901
|
var currentSourceFile = ts.Debug.checkDefined(state.program).getSourceFileByPath(currentPath);
|
|
119859
119902
|
queue.push.apply(queue, ts.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
@@ -119865,56 +119908,38 @@ var ts;
|
|
|
119865
119908
|
var seenFileAndExportsOfFile = new ts.Set();
|
|
119866
119909
|
// Go through exported modules from cache first
|
|
119867
119910
|
// If exported modules has path, all files referencing file exported from are affected
|
|
119868
|
-
(
|
|
119869
|
-
|
|
119870
|
-
|
|
119871
|
-
|
|
119872
|
-
|
|
119873
|
-
|
|
119874
|
-
|
|
119875
|
-
return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
|
|
119876
|
-
!((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) &&
|
|
119877
|
-
forEachFilesReferencingPath(state, exportedFromPath, seenFileAndExportsOfFile, fn);
|
|
119911
|
+
forEachKeyOfExportedModulesMap(state, affectedFile.resolvedPath, function (exportedFromPath) {
|
|
119912
|
+
if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, host))
|
|
119913
|
+
return true;
|
|
119914
|
+
var references = state.referencedMap.getKeys(exportedFromPath);
|
|
119915
|
+
return references && ts.forEachKey(references, function (filePath) {
|
|
119916
|
+
return handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
|
|
119917
|
+
});
|
|
119878
119918
|
});
|
|
119879
119919
|
}
|
|
119880
119920
|
/**
|
|
119881
|
-
*
|
|
119921
|
+
* handle dts and semantic diagnostics on file and iterate on anything that exports this file
|
|
119922
|
+
* return true when all work is done and we can exit handling dts emit and semantic diagnostics
|
|
119882
119923
|
*/
|
|
119883
|
-
function
|
|
119924
|
+
function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, host) {
|
|
119884
119925
|
var _a;
|
|
119885
|
-
|
|
119886
|
-
return
|
|
119887
|
-
|
|
119888
|
-
|
|
119889
|
-
|
|
119890
|
-
* fn on file and iterate on anything that exports this file
|
|
119891
|
-
*/
|
|
119892
|
-
function forEachFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, fn) {
|
|
119893
|
-
var _a, _b, _c;
|
|
119894
|
-
if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath)) {
|
|
119895
|
-
return;
|
|
119896
|
-
}
|
|
119897
|
-
fn(state, filePath);
|
|
119926
|
+
if (!ts.tryAddToSet(seenFileAndExportsOfFile, filePath))
|
|
119927
|
+
return undefined;
|
|
119928
|
+
if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, host))
|
|
119929
|
+
return true;
|
|
119930
|
+
handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, host);
|
|
119898
119931
|
ts.Debug.assert(!!state.currentAffectedFilesExportedModulesMap);
|
|
119899
|
-
// Go through exported modules from cache first
|
|
119900
119932
|
// If exported modules has path, all files referencing file exported from are affected
|
|
119901
|
-
(
|
|
119902
|
-
return
|
|
119903
|
-
});
|
|
119904
|
-
// If exported from path is not from cache and exported modules has path, all files referencing file exported from are affected
|
|
119905
|
-
(_b = state.exportedModulesMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function (exportedFromPath) {
|
|
119906
|
-
var _a;
|
|
119907
|
-
// If the cache had an updated value, skip
|
|
119908
|
-
return !state.currentAffectedFilesExportedModulesMap.hasKey(exportedFromPath) &&
|
|
119909
|
-
!((_a = state.currentAffectedFilesExportedModulesMap.deletedKeys()) === null || _a === void 0 ? void 0 : _a.has(exportedFromPath)) &&
|
|
119910
|
-
forEachFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, fn);
|
|
119933
|
+
forEachKeyOfExportedModulesMap(state, filePath, function (exportedFromPath) {
|
|
119934
|
+
return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, host);
|
|
119911
119935
|
});
|
|
119912
119936
|
// Remove diagnostics of files that import this file (without going to exports of referencing files)
|
|
119913
|
-
(
|
|
119937
|
+
(_a = state.referencedMap.getKeys(filePath)) === null || _a === void 0 ? void 0 : _a.forEach(function (referencingFilePath) {
|
|
119914
119938
|
return !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file
|
|
119915
|
-
|
|
119916
|
-
|
|
119917
|
-
);
|
|
119939
|
+
handleDtsMayChangeOf(// Dont add to seen since this is not yet done with the export removal
|
|
119940
|
+
state, referencingFilePath, cancellationToken, computeHash, host);
|
|
119941
|
+
});
|
|
119942
|
+
return undefined;
|
|
119918
119943
|
}
|
|
119919
119944
|
/**
|
|
119920
119945
|
* This is called after completing operation on the next affected file.
|
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.7.0-dev.
|
|
5
|
+
"version": "4.7.0-dev.20220421",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|