typescript 4.6.0-dev.20220205 → 4.6.0-dev.20220209
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/cs/diagnosticMessages.generated.json +1 -2
- package/lib/de/diagnosticMessages.generated.json +1 -2
- package/lib/es/diagnosticMessages.generated.json +1 -2
- package/lib/fr/diagnosticMessages.generated.json +1 -2
- package/lib/it/diagnosticMessages.generated.json +1 -2
- package/lib/ja/diagnosticMessages.generated.json +1 -2
- package/lib/ko/diagnosticMessages.generated.json +1 -2
- package/lib/pl/diagnosticMessages.generated.json +1 -2
- package/lib/pt-br/diagnosticMessages.generated.json +1 -2
- package/lib/ru/diagnosticMessages.generated.json +1 -2
- package/lib/tr/diagnosticMessages.generated.json +1 -2
- package/lib/tsc.js +41 -3
- package/lib/tsserver.js +83 -11
- package/lib/tsserverlibrary.js +83 -11
- package/lib/typescript.js +80 -9
- package/lib/typescriptServices.js +80 -9
- package/lib/typingsInstaller.js +49 -3
- package/lib/zh-cn/diagnosticMessages.generated.json +1 -2
- package/lib/zh-tw/diagnosticMessages.generated.json +1 -2
- package/package.json +1 -1
package/lib/tsserverlibrary.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220209";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -14091,6 +14091,10 @@ var ts;
|
|
|
14091
14091
|
return undefined;
|
|
14092
14092
|
}
|
|
14093
14093
|
ts.getDeclarationOfKind = getDeclarationOfKind;
|
|
14094
|
+
function getDeclarationsOfKind(symbol, kind) {
|
|
14095
|
+
return ts.filter(symbol.declarations || ts.emptyArray, function (d) { return d.kind === kind; });
|
|
14096
|
+
}
|
|
14097
|
+
ts.getDeclarationsOfKind = getDeclarationsOfKind;
|
|
14094
14098
|
function createSymbolTable(symbols) {
|
|
14095
14099
|
var result = new ts.Map();
|
|
14096
14100
|
if (symbols) {
|
|
@@ -55680,6 +55684,39 @@ var ts;
|
|
|
55680
55684
|
}
|
|
55681
55685
|
return links.type;
|
|
55682
55686
|
}
|
|
55687
|
+
function getWriteTypeOfSymbolWithDeferredType(symbol) {
|
|
55688
|
+
var links = getSymbolLinks(symbol);
|
|
55689
|
+
if (!links.writeType && links.deferralWriteConstituents) {
|
|
55690
|
+
ts.Debug.assertIsDefined(links.deferralParent);
|
|
55691
|
+
ts.Debug.assertIsDefined(links.deferralConstituents);
|
|
55692
|
+
links.writeType = links.deferralParent.flags & 1048576 /* Union */ ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents);
|
|
55693
|
+
}
|
|
55694
|
+
return links.writeType;
|
|
55695
|
+
}
|
|
55696
|
+
/**
|
|
55697
|
+
* Distinct write types come only from set accessors, but union and intersection
|
|
55698
|
+
* properties deriving from set accessors will either pre-compute or defer the
|
|
55699
|
+
* union or intersection of the writeTypes of their constituents. To account for
|
|
55700
|
+
* this, we will assume that any deferred type or transient symbol may have a
|
|
55701
|
+
* `writeType` (or a deferred write type ready to be computed) that should be
|
|
55702
|
+
* used before looking for set accessor declarations.
|
|
55703
|
+
*/
|
|
55704
|
+
function getWriteTypeOfSymbol(symbol) {
|
|
55705
|
+
var checkFlags = ts.getCheckFlags(symbol);
|
|
55706
|
+
if (checkFlags & 65536 /* DeferredType */) {
|
|
55707
|
+
var writeType = getWriteTypeOfSymbolWithDeferredType(symbol);
|
|
55708
|
+
if (writeType) {
|
|
55709
|
+
return writeType;
|
|
55710
|
+
}
|
|
55711
|
+
}
|
|
55712
|
+
if (symbol.flags & 33554432 /* Transient */) {
|
|
55713
|
+
var writeType = symbol.writeType;
|
|
55714
|
+
if (writeType) {
|
|
55715
|
+
return writeType;
|
|
55716
|
+
}
|
|
55717
|
+
}
|
|
55718
|
+
return getSetAccessorTypeOfSymbol(symbol);
|
|
55719
|
+
}
|
|
55683
55720
|
function getSetAccessorTypeOfSymbol(symbol) {
|
|
55684
55721
|
if (symbol.flags & 98304 /* Accessor */) {
|
|
55685
55722
|
var type = getTypeOfSetAccessor(symbol);
|
|
@@ -58050,6 +58087,7 @@ var ts;
|
|
|
58050
58087
|
var firstType;
|
|
58051
58088
|
var nameType;
|
|
58052
58089
|
var propTypes = [];
|
|
58090
|
+
var writeTypes;
|
|
58053
58091
|
var firstValueDeclaration;
|
|
58054
58092
|
var hasNonUniformValueDeclaration = false;
|
|
58055
58093
|
for (var _d = 0, props_1 = props; _d < props_1.length; _d++) {
|
|
@@ -58066,6 +58104,10 @@ var ts;
|
|
|
58066
58104
|
firstType = type;
|
|
58067
58105
|
nameType = getSymbolLinks(prop).nameType;
|
|
58068
58106
|
}
|
|
58107
|
+
var writeType = getWriteTypeOfSymbol(prop);
|
|
58108
|
+
if (writeTypes || writeType !== type) {
|
|
58109
|
+
writeTypes = ts.append(!writeTypes ? propTypes.slice() : writeTypes, writeType);
|
|
58110
|
+
}
|
|
58069
58111
|
else if (type !== firstType) {
|
|
58070
58112
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
58071
58113
|
}
|
|
@@ -58094,9 +58136,13 @@ var ts;
|
|
|
58094
58136
|
result.checkFlags |= 65536 /* DeferredType */;
|
|
58095
58137
|
result.deferralParent = containingType;
|
|
58096
58138
|
result.deferralConstituents = propTypes;
|
|
58139
|
+
result.deferralWriteConstituents = writeTypes;
|
|
58097
58140
|
}
|
|
58098
58141
|
else {
|
|
58099
58142
|
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
58143
|
+
if (writeTypes) {
|
|
58144
|
+
result.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
58145
|
+
}
|
|
58100
58146
|
}
|
|
58101
58147
|
return result;
|
|
58102
58148
|
}
|
|
@@ -59238,7 +59284,7 @@ var ts;
|
|
|
59238
59284
|
}
|
|
59239
59285
|
function getImpliedConstraint(type, checkNode, extendsNode) {
|
|
59240
59286
|
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) :
|
|
59241
|
-
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) :
|
|
59287
|
+
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) :
|
|
59242
59288
|
undefined;
|
|
59243
59289
|
}
|
|
59244
59290
|
function getConditionalFlowTypeOfType(type, node) {
|
|
@@ -73227,7 +73273,7 @@ var ts;
|
|
|
73227
73273
|
error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right));
|
|
73228
73274
|
return errorType;
|
|
73229
73275
|
}
|
|
73230
|
-
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ?
|
|
73276
|
+
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
|
|
73231
73277
|
}
|
|
73232
73278
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
73233
73279
|
}
|
|
@@ -130939,7 +130985,8 @@ var ts;
|
|
|
130939
130985
|
case 103 /* NewKeyword */:
|
|
130940
130986
|
return checker.getContextualType(parent);
|
|
130941
130987
|
case 82 /* CaseKeyword */:
|
|
130942
|
-
|
|
130988
|
+
var caseClause = ts.tryCast(parent, ts.isCaseClause);
|
|
130989
|
+
return caseClause ? ts.getSwitchedType(caseClause, checker) : undefined;
|
|
130943
130990
|
case 18 /* OpenBraceToken */:
|
|
130944
130991
|
return ts.isJsxExpression(parent) && !ts.isJsxElement(parent.parent) && !ts.isJsxFragment(parent.parent) ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined;
|
|
130945
130992
|
default:
|
|
@@ -133584,7 +133631,24 @@ var ts;
|
|
|
133584
133631
|
function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {
|
|
133585
133632
|
scriptKind = ts.ensureScriptKind(fileName, scriptKind);
|
|
133586
133633
|
var scriptTarget = scriptKind === 6 /* JSON */ ? 100 /* JSON */ : ts.getEmitScriptTarget(compilationSettings);
|
|
133634
|
+
var oldBucketCount = buckets.size;
|
|
133587
133635
|
var bucket = ts.getOrUpdate(buckets, key, function () { return new ts.Map(); });
|
|
133636
|
+
if (ts.tracing) {
|
|
133637
|
+
if (buckets.size > oldBucketCount) {
|
|
133638
|
+
// It is interesting, but not definitively problematic if a build requires multiple document registry buckets -
|
|
133639
|
+
// perhaps they are for two projects that don't have any overlap.
|
|
133640
|
+
// Bonus: these events can help us interpret the more interesting event below.
|
|
133641
|
+
ts.tracing.instant("session" /* Session */, "createdDocumentRegistryBucket", { configFilePath: compilationSettings.configFilePath, key: key });
|
|
133642
|
+
}
|
|
133643
|
+
// It is fairly suspicious to have one path in two buckets - you'd expect dependencies to have similar configurations.
|
|
133644
|
+
// If this occurs unexpectedly, the fix is likely to synchronize the project settings.
|
|
133645
|
+
// Skip .d.ts files to reduce noise (should also cover most of node_modules).
|
|
133646
|
+
var otherBucketKey = !ts.fileExtensionIs(path, ".d.ts" /* Dts */) &&
|
|
133647
|
+
ts.forEachEntry(buckets, function (bucket, bucketKey) { return bucketKey !== key && bucket.has(path) && bucketKey; });
|
|
133648
|
+
if (otherBucketKey) {
|
|
133649
|
+
ts.tracing.instant("session" /* Session */, "documentRegistryBucketOverlap", { path: path, key1: otherBucketKey, key2: key });
|
|
133650
|
+
}
|
|
133651
|
+
}
|
|
133588
133652
|
var bucketEntry = bucket.get(path);
|
|
133589
133653
|
var entry = bucketEntry && getDocumentRegistryEntry(bucketEntry, scriptKind);
|
|
133590
133654
|
if (!entry && externalCache) {
|
|
@@ -145720,6 +145784,8 @@ var ts;
|
|
|
145720
145784
|
case 179 /* ConstructorType */:
|
|
145721
145785
|
case 174 /* ConstructSignature */:
|
|
145722
145786
|
return getList(node.typeParameters) || getList(node.parameters);
|
|
145787
|
+
case 171 /* GetAccessor */:
|
|
145788
|
+
return getList(node.parameters);
|
|
145723
145789
|
case 256 /* ClassDeclaration */:
|
|
145724
145790
|
case 225 /* ClassExpression */:
|
|
145725
145791
|
case 257 /* InterfaceDeclaration */:
|
|
@@ -153156,6 +153222,9 @@ var ts;
|
|
|
153156
153222
|
case 172 /* SetAccessor */:
|
|
153157
153223
|
// Setter must have a parameter
|
|
153158
153224
|
return false;
|
|
153225
|
+
case 171 /* GetAccessor */:
|
|
153226
|
+
// Getter cannot have parameters
|
|
153227
|
+
return true;
|
|
153159
153228
|
default:
|
|
153160
153229
|
return ts.Debug.failBadSyntaxKind(parent);
|
|
153161
153230
|
}
|
|
@@ -155766,10 +155835,12 @@ var ts;
|
|
|
155766
155835
|
});
|
|
155767
155836
|
function getInfo(sourceFile, pos) {
|
|
155768
155837
|
var token = ts.getTokenAtPosition(sourceFile, pos);
|
|
155769
|
-
var indexSignature = ts.
|
|
155770
|
-
if (
|
|
155838
|
+
var indexSignature = ts.tryCast(token.parent.parent, ts.isIndexSignatureDeclaration);
|
|
155839
|
+
if (!indexSignature)
|
|
155840
|
+
return undefined;
|
|
155841
|
+
var container = ts.isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : ts.tryCast(indexSignature.parent.parent, ts.isTypeAliasDeclaration);
|
|
155842
|
+
if (!container)
|
|
155771
155843
|
return undefined;
|
|
155772
|
-
var container = ts.isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : ts.cast(indexSignature.parent.parent, ts.isTypeAliasDeclaration);
|
|
155773
155844
|
return { indexSignature: indexSignature, container: container };
|
|
155774
155845
|
}
|
|
155775
155846
|
function createTypeAliasFromInterface(declaration, type) {
|
|
@@ -157360,8 +157431,8 @@ var ts;
|
|
|
157360
157431
|
// but a super *method call* simply implies a 'this' reference
|
|
157361
157432
|
if (node.parent.kind === 207 /* CallExpression */) {
|
|
157362
157433
|
// Super constructor call
|
|
157363
|
-
var containingClass_1 = ts.getContainingClass(node);
|
|
157364
|
-
if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) {
|
|
157434
|
+
var containingClass_1 = ts.getContainingClass(node);
|
|
157435
|
+
if (containingClass_1 === undefined || containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) {
|
|
157365
157436
|
(errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractSuper));
|
|
157366
157437
|
return true;
|
|
157367
157438
|
}
|
|
@@ -171763,9 +171834,10 @@ var ts;
|
|
|
171763
171834
|
var info = infos && ts.firstOrUndefined(infos);
|
|
171764
171835
|
return info && !info.isLocal ? { fileName: info.fileName, pos: info.textSpan.start } : undefined;
|
|
171765
171836
|
}
|
|
171766
|
-
function combineProjectOutputForReferences(projects, defaultProject, initialLocation) {
|
|
171837
|
+
function combineProjectOutputForReferences(projects, defaultProject, initialLocation, logger) {
|
|
171767
171838
|
var outputs = [];
|
|
171768
171839
|
combineProjectOutputWorker(projects, defaultProject, initialLocation, function (project, location, getMappedLocation) {
|
|
171840
|
+
logger.info("Finding references to " + location.fileName + " position " + location.pos + " in project " + project.getProjectName());
|
|
171769
171841
|
var _loop_8 = function (outputReferencedSymbol) {
|
|
171770
171842
|
var mappedDefinitionFile = getMappedLocation(project, documentSpanLocation(outputReferencedSymbol.definition));
|
|
171771
171843
|
var definition = mappedDefinitionFile === undefined ?
|
|
@@ -173123,7 +173195,7 @@ var ts;
|
|
|
173123
173195
|
var file = server.toNormalizedPath(args.file);
|
|
173124
173196
|
var projects = this.getProjects(args);
|
|
173125
173197
|
var position = this.getPositionInFile(args, file);
|
|
173126
|
-
var references = combineProjectOutputForReferences(projects, this.getDefaultProject(args), { fileName: args.file, pos: position });
|
|
173198
|
+
var references = combineProjectOutputForReferences(projects, this.getDefaultProject(args), { fileName: args.file, pos: position }, this.logger);
|
|
173127
173199
|
if (!simplifiedResult)
|
|
173128
173200
|
return references;
|
|
173129
173201
|
var defaultProject = this.getDefaultProject(args);
|
package/lib/typescript.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220209";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -14091,6 +14091,10 @@ var ts;
|
|
|
14091
14091
|
return undefined;
|
|
14092
14092
|
}
|
|
14093
14093
|
ts.getDeclarationOfKind = getDeclarationOfKind;
|
|
14094
|
+
function getDeclarationsOfKind(symbol, kind) {
|
|
14095
|
+
return ts.filter(symbol.declarations || ts.emptyArray, function (d) { return d.kind === kind; });
|
|
14096
|
+
}
|
|
14097
|
+
ts.getDeclarationsOfKind = getDeclarationsOfKind;
|
|
14094
14098
|
function createSymbolTable(symbols) {
|
|
14095
14099
|
var result = new ts.Map();
|
|
14096
14100
|
if (symbols) {
|
|
@@ -55680,6 +55684,39 @@ var ts;
|
|
|
55680
55684
|
}
|
|
55681
55685
|
return links.type;
|
|
55682
55686
|
}
|
|
55687
|
+
function getWriteTypeOfSymbolWithDeferredType(symbol) {
|
|
55688
|
+
var links = getSymbolLinks(symbol);
|
|
55689
|
+
if (!links.writeType && links.deferralWriteConstituents) {
|
|
55690
|
+
ts.Debug.assertIsDefined(links.deferralParent);
|
|
55691
|
+
ts.Debug.assertIsDefined(links.deferralConstituents);
|
|
55692
|
+
links.writeType = links.deferralParent.flags & 1048576 /* Union */ ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents);
|
|
55693
|
+
}
|
|
55694
|
+
return links.writeType;
|
|
55695
|
+
}
|
|
55696
|
+
/**
|
|
55697
|
+
* Distinct write types come only from set accessors, but union and intersection
|
|
55698
|
+
* properties deriving from set accessors will either pre-compute or defer the
|
|
55699
|
+
* union or intersection of the writeTypes of their constituents. To account for
|
|
55700
|
+
* this, we will assume that any deferred type or transient symbol may have a
|
|
55701
|
+
* `writeType` (or a deferred write type ready to be computed) that should be
|
|
55702
|
+
* used before looking for set accessor declarations.
|
|
55703
|
+
*/
|
|
55704
|
+
function getWriteTypeOfSymbol(symbol) {
|
|
55705
|
+
var checkFlags = ts.getCheckFlags(symbol);
|
|
55706
|
+
if (checkFlags & 65536 /* DeferredType */) {
|
|
55707
|
+
var writeType = getWriteTypeOfSymbolWithDeferredType(symbol);
|
|
55708
|
+
if (writeType) {
|
|
55709
|
+
return writeType;
|
|
55710
|
+
}
|
|
55711
|
+
}
|
|
55712
|
+
if (symbol.flags & 33554432 /* Transient */) {
|
|
55713
|
+
var writeType = symbol.writeType;
|
|
55714
|
+
if (writeType) {
|
|
55715
|
+
return writeType;
|
|
55716
|
+
}
|
|
55717
|
+
}
|
|
55718
|
+
return getSetAccessorTypeOfSymbol(symbol);
|
|
55719
|
+
}
|
|
55683
55720
|
function getSetAccessorTypeOfSymbol(symbol) {
|
|
55684
55721
|
if (symbol.flags & 98304 /* Accessor */) {
|
|
55685
55722
|
var type = getTypeOfSetAccessor(symbol);
|
|
@@ -58050,6 +58087,7 @@ var ts;
|
|
|
58050
58087
|
var firstType;
|
|
58051
58088
|
var nameType;
|
|
58052
58089
|
var propTypes = [];
|
|
58090
|
+
var writeTypes;
|
|
58053
58091
|
var firstValueDeclaration;
|
|
58054
58092
|
var hasNonUniformValueDeclaration = false;
|
|
58055
58093
|
for (var _d = 0, props_1 = props; _d < props_1.length; _d++) {
|
|
@@ -58066,6 +58104,10 @@ var ts;
|
|
|
58066
58104
|
firstType = type;
|
|
58067
58105
|
nameType = getSymbolLinks(prop).nameType;
|
|
58068
58106
|
}
|
|
58107
|
+
var writeType = getWriteTypeOfSymbol(prop);
|
|
58108
|
+
if (writeTypes || writeType !== type) {
|
|
58109
|
+
writeTypes = ts.append(!writeTypes ? propTypes.slice() : writeTypes, writeType);
|
|
58110
|
+
}
|
|
58069
58111
|
else if (type !== firstType) {
|
|
58070
58112
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
58071
58113
|
}
|
|
@@ -58094,9 +58136,13 @@ var ts;
|
|
|
58094
58136
|
result.checkFlags |= 65536 /* DeferredType */;
|
|
58095
58137
|
result.deferralParent = containingType;
|
|
58096
58138
|
result.deferralConstituents = propTypes;
|
|
58139
|
+
result.deferralWriteConstituents = writeTypes;
|
|
58097
58140
|
}
|
|
58098
58141
|
else {
|
|
58099
58142
|
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
58143
|
+
if (writeTypes) {
|
|
58144
|
+
result.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
58145
|
+
}
|
|
58100
58146
|
}
|
|
58101
58147
|
return result;
|
|
58102
58148
|
}
|
|
@@ -59238,7 +59284,7 @@ var ts;
|
|
|
59238
59284
|
}
|
|
59239
59285
|
function getImpliedConstraint(type, checkNode, extendsNode) {
|
|
59240
59286
|
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) :
|
|
59241
|
-
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) :
|
|
59287
|
+
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) :
|
|
59242
59288
|
undefined;
|
|
59243
59289
|
}
|
|
59244
59290
|
function getConditionalFlowTypeOfType(type, node) {
|
|
@@ -73227,7 +73273,7 @@ var ts;
|
|
|
73227
73273
|
error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right));
|
|
73228
73274
|
return errorType;
|
|
73229
73275
|
}
|
|
73230
|
-
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ?
|
|
73276
|
+
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
|
|
73231
73277
|
}
|
|
73232
73278
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
73233
73279
|
}
|
|
@@ -130939,7 +130985,8 @@ var ts;
|
|
|
130939
130985
|
case 103 /* NewKeyword */:
|
|
130940
130986
|
return checker.getContextualType(parent);
|
|
130941
130987
|
case 82 /* CaseKeyword */:
|
|
130942
|
-
|
|
130988
|
+
var caseClause = ts.tryCast(parent, ts.isCaseClause);
|
|
130989
|
+
return caseClause ? ts.getSwitchedType(caseClause, checker) : undefined;
|
|
130943
130990
|
case 18 /* OpenBraceToken */:
|
|
130944
130991
|
return ts.isJsxExpression(parent) && !ts.isJsxElement(parent.parent) && !ts.isJsxFragment(parent.parent) ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined;
|
|
130945
130992
|
default:
|
|
@@ -133584,7 +133631,24 @@ var ts;
|
|
|
133584
133631
|
function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {
|
|
133585
133632
|
scriptKind = ts.ensureScriptKind(fileName, scriptKind);
|
|
133586
133633
|
var scriptTarget = scriptKind === 6 /* JSON */ ? 100 /* JSON */ : ts.getEmitScriptTarget(compilationSettings);
|
|
133634
|
+
var oldBucketCount = buckets.size;
|
|
133587
133635
|
var bucket = ts.getOrUpdate(buckets, key, function () { return new ts.Map(); });
|
|
133636
|
+
if (ts.tracing) {
|
|
133637
|
+
if (buckets.size > oldBucketCount) {
|
|
133638
|
+
// It is interesting, but not definitively problematic if a build requires multiple document registry buckets -
|
|
133639
|
+
// perhaps they are for two projects that don't have any overlap.
|
|
133640
|
+
// Bonus: these events can help us interpret the more interesting event below.
|
|
133641
|
+
ts.tracing.instant("session" /* Session */, "createdDocumentRegistryBucket", { configFilePath: compilationSettings.configFilePath, key: key });
|
|
133642
|
+
}
|
|
133643
|
+
// It is fairly suspicious to have one path in two buckets - you'd expect dependencies to have similar configurations.
|
|
133644
|
+
// If this occurs unexpectedly, the fix is likely to synchronize the project settings.
|
|
133645
|
+
// Skip .d.ts files to reduce noise (should also cover most of node_modules).
|
|
133646
|
+
var otherBucketKey = !ts.fileExtensionIs(path, ".d.ts" /* Dts */) &&
|
|
133647
|
+
ts.forEachEntry(buckets, function (bucket, bucketKey) { return bucketKey !== key && bucket.has(path) && bucketKey; });
|
|
133648
|
+
if (otherBucketKey) {
|
|
133649
|
+
ts.tracing.instant("session" /* Session */, "documentRegistryBucketOverlap", { path: path, key1: otherBucketKey, key2: key });
|
|
133650
|
+
}
|
|
133651
|
+
}
|
|
133588
133652
|
var bucketEntry = bucket.get(path);
|
|
133589
133653
|
var entry = bucketEntry && getDocumentRegistryEntry(bucketEntry, scriptKind);
|
|
133590
133654
|
if (!entry && externalCache) {
|
|
@@ -145720,6 +145784,8 @@ var ts;
|
|
|
145720
145784
|
case 179 /* ConstructorType */:
|
|
145721
145785
|
case 174 /* ConstructSignature */:
|
|
145722
145786
|
return getList(node.typeParameters) || getList(node.parameters);
|
|
145787
|
+
case 171 /* GetAccessor */:
|
|
145788
|
+
return getList(node.parameters);
|
|
145723
145789
|
case 256 /* ClassDeclaration */:
|
|
145724
145790
|
case 225 /* ClassExpression */:
|
|
145725
145791
|
case 257 /* InterfaceDeclaration */:
|
|
@@ -153156,6 +153222,9 @@ var ts;
|
|
|
153156
153222
|
case 172 /* SetAccessor */:
|
|
153157
153223
|
// Setter must have a parameter
|
|
153158
153224
|
return false;
|
|
153225
|
+
case 171 /* GetAccessor */:
|
|
153226
|
+
// Getter cannot have parameters
|
|
153227
|
+
return true;
|
|
153159
153228
|
default:
|
|
153160
153229
|
return ts.Debug.failBadSyntaxKind(parent);
|
|
153161
153230
|
}
|
|
@@ -155766,10 +155835,12 @@ var ts;
|
|
|
155766
155835
|
});
|
|
155767
155836
|
function getInfo(sourceFile, pos) {
|
|
155768
155837
|
var token = ts.getTokenAtPosition(sourceFile, pos);
|
|
155769
|
-
var indexSignature = ts.
|
|
155770
|
-
if (
|
|
155838
|
+
var indexSignature = ts.tryCast(token.parent.parent, ts.isIndexSignatureDeclaration);
|
|
155839
|
+
if (!indexSignature)
|
|
155840
|
+
return undefined;
|
|
155841
|
+
var container = ts.isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : ts.tryCast(indexSignature.parent.parent, ts.isTypeAliasDeclaration);
|
|
155842
|
+
if (!container)
|
|
155771
155843
|
return undefined;
|
|
155772
|
-
var container = ts.isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : ts.cast(indexSignature.parent.parent, ts.isTypeAliasDeclaration);
|
|
155773
155844
|
return { indexSignature: indexSignature, container: container };
|
|
155774
155845
|
}
|
|
155775
155846
|
function createTypeAliasFromInterface(declaration, type) {
|
|
@@ -157360,8 +157431,8 @@ var ts;
|
|
|
157360
157431
|
// but a super *method call* simply implies a 'this' reference
|
|
157361
157432
|
if (node.parent.kind === 207 /* CallExpression */) {
|
|
157362
157433
|
// Super constructor call
|
|
157363
|
-
var containingClass_1 = ts.getContainingClass(node);
|
|
157364
|
-
if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) {
|
|
157434
|
+
var containingClass_1 = ts.getContainingClass(node);
|
|
157435
|
+
if (containingClass_1 === undefined || containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) {
|
|
157365
157436
|
(errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractSuper));
|
|
157366
157437
|
return true;
|
|
157367
157438
|
}
|
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220209";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -14091,6 +14091,10 @@ var ts;
|
|
|
14091
14091
|
return undefined;
|
|
14092
14092
|
}
|
|
14093
14093
|
ts.getDeclarationOfKind = getDeclarationOfKind;
|
|
14094
|
+
function getDeclarationsOfKind(symbol, kind) {
|
|
14095
|
+
return ts.filter(symbol.declarations || ts.emptyArray, function (d) { return d.kind === kind; });
|
|
14096
|
+
}
|
|
14097
|
+
ts.getDeclarationsOfKind = getDeclarationsOfKind;
|
|
14094
14098
|
function createSymbolTable(symbols) {
|
|
14095
14099
|
var result = new ts.Map();
|
|
14096
14100
|
if (symbols) {
|
|
@@ -55680,6 +55684,39 @@ var ts;
|
|
|
55680
55684
|
}
|
|
55681
55685
|
return links.type;
|
|
55682
55686
|
}
|
|
55687
|
+
function getWriteTypeOfSymbolWithDeferredType(symbol) {
|
|
55688
|
+
var links = getSymbolLinks(symbol);
|
|
55689
|
+
if (!links.writeType && links.deferralWriteConstituents) {
|
|
55690
|
+
ts.Debug.assertIsDefined(links.deferralParent);
|
|
55691
|
+
ts.Debug.assertIsDefined(links.deferralConstituents);
|
|
55692
|
+
links.writeType = links.deferralParent.flags & 1048576 /* Union */ ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents);
|
|
55693
|
+
}
|
|
55694
|
+
return links.writeType;
|
|
55695
|
+
}
|
|
55696
|
+
/**
|
|
55697
|
+
* Distinct write types come only from set accessors, but union and intersection
|
|
55698
|
+
* properties deriving from set accessors will either pre-compute or defer the
|
|
55699
|
+
* union or intersection of the writeTypes of their constituents. To account for
|
|
55700
|
+
* this, we will assume that any deferred type or transient symbol may have a
|
|
55701
|
+
* `writeType` (or a deferred write type ready to be computed) that should be
|
|
55702
|
+
* used before looking for set accessor declarations.
|
|
55703
|
+
*/
|
|
55704
|
+
function getWriteTypeOfSymbol(symbol) {
|
|
55705
|
+
var checkFlags = ts.getCheckFlags(symbol);
|
|
55706
|
+
if (checkFlags & 65536 /* DeferredType */) {
|
|
55707
|
+
var writeType = getWriteTypeOfSymbolWithDeferredType(symbol);
|
|
55708
|
+
if (writeType) {
|
|
55709
|
+
return writeType;
|
|
55710
|
+
}
|
|
55711
|
+
}
|
|
55712
|
+
if (symbol.flags & 33554432 /* Transient */) {
|
|
55713
|
+
var writeType = symbol.writeType;
|
|
55714
|
+
if (writeType) {
|
|
55715
|
+
return writeType;
|
|
55716
|
+
}
|
|
55717
|
+
}
|
|
55718
|
+
return getSetAccessorTypeOfSymbol(symbol);
|
|
55719
|
+
}
|
|
55683
55720
|
function getSetAccessorTypeOfSymbol(symbol) {
|
|
55684
55721
|
if (symbol.flags & 98304 /* Accessor */) {
|
|
55685
55722
|
var type = getTypeOfSetAccessor(symbol);
|
|
@@ -58050,6 +58087,7 @@ var ts;
|
|
|
58050
58087
|
var firstType;
|
|
58051
58088
|
var nameType;
|
|
58052
58089
|
var propTypes = [];
|
|
58090
|
+
var writeTypes;
|
|
58053
58091
|
var firstValueDeclaration;
|
|
58054
58092
|
var hasNonUniformValueDeclaration = false;
|
|
58055
58093
|
for (var _d = 0, props_1 = props; _d < props_1.length; _d++) {
|
|
@@ -58066,6 +58104,10 @@ var ts;
|
|
|
58066
58104
|
firstType = type;
|
|
58067
58105
|
nameType = getSymbolLinks(prop).nameType;
|
|
58068
58106
|
}
|
|
58107
|
+
var writeType = getWriteTypeOfSymbol(prop);
|
|
58108
|
+
if (writeTypes || writeType !== type) {
|
|
58109
|
+
writeTypes = ts.append(!writeTypes ? propTypes.slice() : writeTypes, writeType);
|
|
58110
|
+
}
|
|
58069
58111
|
else if (type !== firstType) {
|
|
58070
58112
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
58071
58113
|
}
|
|
@@ -58094,9 +58136,13 @@ var ts;
|
|
|
58094
58136
|
result.checkFlags |= 65536 /* DeferredType */;
|
|
58095
58137
|
result.deferralParent = containingType;
|
|
58096
58138
|
result.deferralConstituents = propTypes;
|
|
58139
|
+
result.deferralWriteConstituents = writeTypes;
|
|
58097
58140
|
}
|
|
58098
58141
|
else {
|
|
58099
58142
|
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
58143
|
+
if (writeTypes) {
|
|
58144
|
+
result.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
58145
|
+
}
|
|
58100
58146
|
}
|
|
58101
58147
|
return result;
|
|
58102
58148
|
}
|
|
@@ -59238,7 +59284,7 @@ var ts;
|
|
|
59238
59284
|
}
|
|
59239
59285
|
function getImpliedConstraint(type, checkNode, extendsNode) {
|
|
59240
59286
|
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) :
|
|
59241
|
-
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) :
|
|
59287
|
+
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) :
|
|
59242
59288
|
undefined;
|
|
59243
59289
|
}
|
|
59244
59290
|
function getConditionalFlowTypeOfType(type, node) {
|
|
@@ -73227,7 +73273,7 @@ var ts;
|
|
|
73227
73273
|
error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right));
|
|
73228
73274
|
return errorType;
|
|
73229
73275
|
}
|
|
73230
|
-
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ?
|
|
73276
|
+
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
|
|
73231
73277
|
}
|
|
73232
73278
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
73233
73279
|
}
|
|
@@ -130939,7 +130985,8 @@ var ts;
|
|
|
130939
130985
|
case 103 /* NewKeyword */:
|
|
130940
130986
|
return checker.getContextualType(parent);
|
|
130941
130987
|
case 82 /* CaseKeyword */:
|
|
130942
|
-
|
|
130988
|
+
var caseClause = ts.tryCast(parent, ts.isCaseClause);
|
|
130989
|
+
return caseClause ? ts.getSwitchedType(caseClause, checker) : undefined;
|
|
130943
130990
|
case 18 /* OpenBraceToken */:
|
|
130944
130991
|
return ts.isJsxExpression(parent) && !ts.isJsxElement(parent.parent) && !ts.isJsxFragment(parent.parent) ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined;
|
|
130945
130992
|
default:
|
|
@@ -133584,7 +133631,24 @@ var ts;
|
|
|
133584
133631
|
function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {
|
|
133585
133632
|
scriptKind = ts.ensureScriptKind(fileName, scriptKind);
|
|
133586
133633
|
var scriptTarget = scriptKind === 6 /* JSON */ ? 100 /* JSON */ : ts.getEmitScriptTarget(compilationSettings);
|
|
133634
|
+
var oldBucketCount = buckets.size;
|
|
133587
133635
|
var bucket = ts.getOrUpdate(buckets, key, function () { return new ts.Map(); });
|
|
133636
|
+
if (ts.tracing) {
|
|
133637
|
+
if (buckets.size > oldBucketCount) {
|
|
133638
|
+
// It is interesting, but not definitively problematic if a build requires multiple document registry buckets -
|
|
133639
|
+
// perhaps they are for two projects that don't have any overlap.
|
|
133640
|
+
// Bonus: these events can help us interpret the more interesting event below.
|
|
133641
|
+
ts.tracing.instant("session" /* Session */, "createdDocumentRegistryBucket", { configFilePath: compilationSettings.configFilePath, key: key });
|
|
133642
|
+
}
|
|
133643
|
+
// It is fairly suspicious to have one path in two buckets - you'd expect dependencies to have similar configurations.
|
|
133644
|
+
// If this occurs unexpectedly, the fix is likely to synchronize the project settings.
|
|
133645
|
+
// Skip .d.ts files to reduce noise (should also cover most of node_modules).
|
|
133646
|
+
var otherBucketKey = !ts.fileExtensionIs(path, ".d.ts" /* Dts */) &&
|
|
133647
|
+
ts.forEachEntry(buckets, function (bucket, bucketKey) { return bucketKey !== key && bucket.has(path) && bucketKey; });
|
|
133648
|
+
if (otherBucketKey) {
|
|
133649
|
+
ts.tracing.instant("session" /* Session */, "documentRegistryBucketOverlap", { path: path, key1: otherBucketKey, key2: key });
|
|
133650
|
+
}
|
|
133651
|
+
}
|
|
133588
133652
|
var bucketEntry = bucket.get(path);
|
|
133589
133653
|
var entry = bucketEntry && getDocumentRegistryEntry(bucketEntry, scriptKind);
|
|
133590
133654
|
if (!entry && externalCache) {
|
|
@@ -145720,6 +145784,8 @@ var ts;
|
|
|
145720
145784
|
case 179 /* ConstructorType */:
|
|
145721
145785
|
case 174 /* ConstructSignature */:
|
|
145722
145786
|
return getList(node.typeParameters) || getList(node.parameters);
|
|
145787
|
+
case 171 /* GetAccessor */:
|
|
145788
|
+
return getList(node.parameters);
|
|
145723
145789
|
case 256 /* ClassDeclaration */:
|
|
145724
145790
|
case 225 /* ClassExpression */:
|
|
145725
145791
|
case 257 /* InterfaceDeclaration */:
|
|
@@ -153156,6 +153222,9 @@ var ts;
|
|
|
153156
153222
|
case 172 /* SetAccessor */:
|
|
153157
153223
|
// Setter must have a parameter
|
|
153158
153224
|
return false;
|
|
153225
|
+
case 171 /* GetAccessor */:
|
|
153226
|
+
// Getter cannot have parameters
|
|
153227
|
+
return true;
|
|
153159
153228
|
default:
|
|
153160
153229
|
return ts.Debug.failBadSyntaxKind(parent);
|
|
153161
153230
|
}
|
|
@@ -155766,10 +155835,12 @@ var ts;
|
|
|
155766
155835
|
});
|
|
155767
155836
|
function getInfo(sourceFile, pos) {
|
|
155768
155837
|
var token = ts.getTokenAtPosition(sourceFile, pos);
|
|
155769
|
-
var indexSignature = ts.
|
|
155770
|
-
if (
|
|
155838
|
+
var indexSignature = ts.tryCast(token.parent.parent, ts.isIndexSignatureDeclaration);
|
|
155839
|
+
if (!indexSignature)
|
|
155840
|
+
return undefined;
|
|
155841
|
+
var container = ts.isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : ts.tryCast(indexSignature.parent.parent, ts.isTypeAliasDeclaration);
|
|
155842
|
+
if (!container)
|
|
155771
155843
|
return undefined;
|
|
155772
|
-
var container = ts.isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : ts.cast(indexSignature.parent.parent, ts.isTypeAliasDeclaration);
|
|
155773
155844
|
return { indexSignature: indexSignature, container: container };
|
|
155774
155845
|
}
|
|
155775
155846
|
function createTypeAliasFromInterface(declaration, type) {
|
|
@@ -157360,8 +157431,8 @@ var ts;
|
|
|
157360
157431
|
// but a super *method call* simply implies a 'this' reference
|
|
157361
157432
|
if (node.parent.kind === 207 /* CallExpression */) {
|
|
157362
157433
|
// Super constructor call
|
|
157363
|
-
var containingClass_1 = ts.getContainingClass(node);
|
|
157364
|
-
if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) {
|
|
157434
|
+
var containingClass_1 = ts.getContainingClass(node);
|
|
157435
|
+
if (containingClass_1 === undefined || containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) {
|
|
157365
157436
|
(errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractSuper));
|
|
157366
157437
|
return true;
|
|
157367
157438
|
}
|