typescript 4.9.0-dev.20220824 → 4.9.0-dev.20220825
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 +28 -6
- package/lib/tsserver.js +38 -14
- package/lib/tsserverlibrary.js +38 -14
- package/lib/typescript.js +36 -12
- package/lib/typescriptServices.js +36 -12
- package/lib/typingsInstaller.js +32 -7
- 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 = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220825";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -40197,6 +40197,7 @@ var ts;
|
|
|
40197
40197
|
signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
|
|
40198
40198
|
symbolToEntityName: nodeBuilder.symbolToEntityName,
|
|
40199
40199
|
symbolToExpression: nodeBuilder.symbolToExpression,
|
|
40200
|
+
symbolToNode: nodeBuilder.symbolToNode,
|
|
40200
40201
|
symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations,
|
|
40201
40202
|
symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration,
|
|
40202
40203
|
typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration,
|
|
@@ -42525,7 +42526,7 @@ var ts;
|
|
|
42525
42526
|
}
|
|
42526
42527
|
}
|
|
42527
42528
|
function getFullyQualifiedName(symbol, containingLocation) {
|
|
42528
|
-
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, undefined,
|
|
42529
|
+
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, undefined, 32 | 4);
|
|
42529
42530
|
}
|
|
42530
42531
|
function getContainingQualifiedNameNode(node) {
|
|
42531
42532
|
while (ts.isQualifiedName(node.parent)) {
|
|
@@ -43676,10 +43677,13 @@ var ts;
|
|
|
43676
43677
|
if (flags & 8) {
|
|
43677
43678
|
nodeFlags |= 16384;
|
|
43678
43679
|
}
|
|
43679
|
-
if (flags &
|
|
43680
|
+
if (flags & 32) {
|
|
43680
43681
|
nodeFlags |= 134217728;
|
|
43681
43682
|
}
|
|
43682
|
-
|
|
43683
|
+
if (flags & 16) {
|
|
43684
|
+
nodeFlags |= 1073741824;
|
|
43685
|
+
}
|
|
43686
|
+
var builder = flags & 4 ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName;
|
|
43683
43687
|
return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker);
|
|
43684
43688
|
function symbolToStringWorker(writer) {
|
|
43685
43689
|
var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
|
|
@@ -43776,7 +43780,25 @@ var ts;
|
|
|
43776
43780
|
symbolTableToDeclarationStatements: function (symbolTable, enclosingDeclaration, flags, tracker, bundled) {
|
|
43777
43781
|
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolTableToDeclarationStatements(symbolTable, context, bundled); });
|
|
43778
43782
|
},
|
|
43783
|
+
symbolToNode: function (symbol, meaning, enclosingDeclaration, flags, tracker) {
|
|
43784
|
+
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToNode(symbol, context, meaning); });
|
|
43785
|
+
},
|
|
43779
43786
|
};
|
|
43787
|
+
function symbolToNode(symbol, context, meaning) {
|
|
43788
|
+
if (context.flags & 1073741824) {
|
|
43789
|
+
if (symbol.valueDeclaration) {
|
|
43790
|
+
var name = ts.getNameOfDeclaration(symbol.valueDeclaration);
|
|
43791
|
+
if (name && ts.isComputedPropertyName(name))
|
|
43792
|
+
return name;
|
|
43793
|
+
}
|
|
43794
|
+
var nameType = getSymbolLinks(symbol).nameType;
|
|
43795
|
+
if (nameType && nameType.flags & (1024 | 8192)) {
|
|
43796
|
+
context.enclosingDeclaration = nameType.symbol.valueDeclaration;
|
|
43797
|
+
return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, meaning));
|
|
43798
|
+
}
|
|
43799
|
+
}
|
|
43800
|
+
return symbolToExpression(symbol, context, meaning);
|
|
43801
|
+
}
|
|
43780
43802
|
function withContext(enclosingDeclaration, flags, tracker, cb) {
|
|
43781
43803
|
var _a, _b;
|
|
43782
43804
|
ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0);
|
|
@@ -55031,7 +55053,7 @@ var ts;
|
|
|
55031
55053
|
return 0;
|
|
55032
55054
|
}
|
|
55033
55055
|
}
|
|
55034
|
-
var isPerformingCommonPropertyChecks = (relation !== comparableRelation ||
|
|
55056
|
+
var isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & 1048576) && isLiteralType(source)) &&
|
|
55035
55057
|
!(intersectionState & 2) &&
|
|
55036
55058
|
source.flags & (131068 | 524288 | 2097152) && source !== globalObjectType &&
|
|
55037
55059
|
target.flags & (524288 | 2097152) && isWeakType(target) &&
|
|
@@ -56144,7 +56166,7 @@ var ts;
|
|
|
56144
56166
|
shouldSkipElaboration = true;
|
|
56145
56167
|
}
|
|
56146
56168
|
if (props.length === 1) {
|
|
56147
|
-
var propName = symbolToString(unmatchedProperty);
|
|
56169
|
+
var propName = symbolToString(unmatchedProperty, undefined, 0, 4 | 16);
|
|
56148
56170
|
reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
|
|
56149
56171
|
if (ts.length(unmatchedProperty.declarations)) {
|
|
56150
56172
|
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
|
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 = ts.versionMajorMinor + ".0-dev.
|
|
112
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220825";
|
|
113
113
|
/* @internal */
|
|
114
114
|
var Comparison;
|
|
115
115
|
(function (Comparison) {
|
|
@@ -4841,6 +4841,7 @@ var ts;
|
|
|
4841
4841
|
NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple";
|
|
4842
4842
|
NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType";
|
|
4843
4843
|
NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType";
|
|
4844
|
+
/* @internal */ NodeBuilderFlags[NodeBuilderFlags["WriteComputedProps"] = 1073741824] = "WriteComputedProps";
|
|
4844
4845
|
// Errors (cont.)
|
|
4845
4846
|
NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths";
|
|
4846
4847
|
/* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain";
|
|
@@ -4901,8 +4902,10 @@ var ts;
|
|
|
4901
4902
|
SymbolFormatFlags[SymbolFormatFlags["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind";
|
|
4902
4903
|
// Prefer aliases which are not directly visible
|
|
4903
4904
|
SymbolFormatFlags[SymbolFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope";
|
|
4905
|
+
// { [E.A]: 1 }
|
|
4906
|
+
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["WriteComputedProps"] = 16] = "WriteComputedProps";
|
|
4904
4907
|
// Skip building an accessible symbol chain
|
|
4905
|
-
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] =
|
|
4908
|
+
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] = 32] = "DoNotIncludeSymbolChain";
|
|
4906
4909
|
})(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {}));
|
|
4907
4910
|
/* @internal */
|
|
4908
4911
|
var SymbolAccessibility;
|
|
@@ -49060,6 +49063,7 @@ var ts;
|
|
|
49060
49063
|
signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
|
|
49061
49064
|
symbolToEntityName: nodeBuilder.symbolToEntityName,
|
|
49062
49065
|
symbolToExpression: nodeBuilder.symbolToExpression,
|
|
49066
|
+
symbolToNode: nodeBuilder.symbolToNode,
|
|
49063
49067
|
symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations,
|
|
49064
49068
|
symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration,
|
|
49065
49069
|
typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration,
|
|
@@ -51715,7 +51719,7 @@ var ts;
|
|
|
51715
51719
|
}
|
|
51716
51720
|
}
|
|
51717
51721
|
function getFullyQualifiedName(symbol, containingLocation) {
|
|
51718
|
-
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined,
|
|
51722
|
+
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined, 32 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */);
|
|
51719
51723
|
}
|
|
51720
51724
|
function getContainingQualifiedNameNode(node) {
|
|
51721
51725
|
while (ts.isQualifiedName(node.parent)) {
|
|
@@ -53030,10 +53034,13 @@ var ts;
|
|
|
53030
53034
|
if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) {
|
|
53031
53035
|
nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */;
|
|
53032
53036
|
}
|
|
53033
|
-
if (flags &
|
|
53037
|
+
if (flags & 32 /* DoNotIncludeSymbolChain */) {
|
|
53034
53038
|
nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */;
|
|
53035
53039
|
}
|
|
53036
|
-
|
|
53040
|
+
if (flags & 16 /* WriteComputedProps */) {
|
|
53041
|
+
nodeFlags |= 1073741824 /* WriteComputedProps */;
|
|
53042
|
+
}
|
|
53043
|
+
var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName;
|
|
53037
53044
|
return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker);
|
|
53038
53045
|
function symbolToStringWorker(writer) {
|
|
53039
53046
|
var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217
|
|
@@ -53133,7 +53140,25 @@ var ts;
|
|
|
53133
53140
|
symbolTableToDeclarationStatements: function (symbolTable, enclosingDeclaration, flags, tracker, bundled) {
|
|
53134
53141
|
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolTableToDeclarationStatements(symbolTable, context, bundled); });
|
|
53135
53142
|
},
|
|
53143
|
+
symbolToNode: function (symbol, meaning, enclosingDeclaration, flags, tracker) {
|
|
53144
|
+
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToNode(symbol, context, meaning); });
|
|
53145
|
+
},
|
|
53136
53146
|
};
|
|
53147
|
+
function symbolToNode(symbol, context, meaning) {
|
|
53148
|
+
if (context.flags & 1073741824 /* WriteComputedProps */) {
|
|
53149
|
+
if (symbol.valueDeclaration) {
|
|
53150
|
+
var name = ts.getNameOfDeclaration(symbol.valueDeclaration);
|
|
53151
|
+
if (name && ts.isComputedPropertyName(name))
|
|
53152
|
+
return name;
|
|
53153
|
+
}
|
|
53154
|
+
var nameType = getSymbolLinks(symbol).nameType;
|
|
53155
|
+
if (nameType && nameType.flags & (1024 /* EnumLiteral */ | 8192 /* UniqueESSymbol */)) {
|
|
53156
|
+
context.enclosingDeclaration = nameType.symbol.valueDeclaration;
|
|
53157
|
+
return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, meaning));
|
|
53158
|
+
}
|
|
53159
|
+
}
|
|
53160
|
+
return symbolToExpression(symbol, context, meaning);
|
|
53161
|
+
}
|
|
53137
53162
|
function withContext(enclosingDeclaration, flags, tracker, cb) {
|
|
53138
53163
|
var _a, _b;
|
|
53139
53164
|
ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0);
|
|
@@ -65937,7 +65962,7 @@ var ts;
|
|
|
65937
65962
|
return 0 /* False */;
|
|
65938
65963
|
}
|
|
65939
65964
|
}
|
|
65940
|
-
var isPerformingCommonPropertyChecks = (relation !== comparableRelation ||
|
|
65965
|
+
var isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & 1048576 /* Union */) && isLiteralType(source)) &&
|
|
65941
65966
|
!(intersectionState & 2 /* Target */) &&
|
|
65942
65967
|
source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
|
|
65943
65968
|
target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
|
|
@@ -67316,7 +67341,7 @@ var ts;
|
|
|
67316
67341
|
shouldSkipElaboration = true; // Retain top-level error for interface implementing issues, otherwise omit it
|
|
67317
67342
|
}
|
|
67318
67343
|
if (props.length === 1) {
|
|
67319
|
-
var propName = symbolToString(unmatchedProperty);
|
|
67344
|
+
var propName = symbolToString(unmatchedProperty, /*enclosingDeclaration*/ undefined, 0 /* None */, 4 /* AllowAnyNodeKind */ | 16 /* WriteComputedProps */);
|
|
67320
67345
|
reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
|
|
67321
67346
|
if (ts.length(unmatchedProperty.declarations)) {
|
|
67322
67347
|
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
|
|
@@ -157404,11 +157429,10 @@ var ts;
|
|
|
157404
157429
|
return declaration && declaration.parent === node ? declaration : undefined;
|
|
157405
157430
|
}
|
|
157406
157431
|
function createPropertyNameFromSymbol(symbol, target, quotePreference, checker) {
|
|
157407
|
-
if (ts.isTransientSymbol(symbol)
|
|
157408
|
-
var
|
|
157409
|
-
if (
|
|
157410
|
-
return
|
|
157411
|
-
}
|
|
157432
|
+
if (ts.isTransientSymbol(symbol)) {
|
|
157433
|
+
var prop = checker.symbolToNode(symbol, 111551 /* Value */, /*enclosingDeclaration*/ undefined, 1073741824 /* WriteComputedProps */);
|
|
157434
|
+
if (prop && ts.isComputedPropertyName(prop))
|
|
157435
|
+
return prop;
|
|
157412
157436
|
}
|
|
157413
157437
|
return ts.createPropertyNameNodeForIdentifierOrLiteral(symbol.name, target, quotePreference === 0 /* Single */);
|
|
157414
157438
|
}
|
|
@@ -179630,9 +179654,9 @@ var ts;
|
|
|
179630
179654
|
};
|
|
179631
179655
|
Session.prototype.getFileAndLanguageServiceForSyntacticOperation = function (args) {
|
|
179632
179656
|
// Since this is syntactic operation, there should always be project for the file
|
|
179633
|
-
//
|
|
179657
|
+
// throw if we dont get project
|
|
179634
179658
|
var file = server.toNormalizedPath(args.file);
|
|
179635
|
-
var project = this.getProject(args.projectFileName) || this.projectService.
|
|
179659
|
+
var project = this.getProject(args.projectFileName) || this.projectService.ensureDefaultProjectForFile(file);
|
|
179636
179660
|
if (!project) {
|
|
179637
179661
|
return server.Errors.ThrowNoProject();
|
|
179638
179662
|
}
|
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 = ts.versionMajorMinor + ".0-dev.
|
|
111
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220825";
|
|
112
112
|
/* @internal */
|
|
113
113
|
var Comparison;
|
|
114
114
|
(function (Comparison) {
|
|
@@ -4840,6 +4840,7 @@ var ts;
|
|
|
4840
4840
|
NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple";
|
|
4841
4841
|
NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType";
|
|
4842
4842
|
NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType";
|
|
4843
|
+
/* @internal */ NodeBuilderFlags[NodeBuilderFlags["WriteComputedProps"] = 1073741824] = "WriteComputedProps";
|
|
4843
4844
|
// Errors (cont.)
|
|
4844
4845
|
NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths";
|
|
4845
4846
|
/* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain";
|
|
@@ -4900,8 +4901,10 @@ var ts;
|
|
|
4900
4901
|
SymbolFormatFlags[SymbolFormatFlags["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind";
|
|
4901
4902
|
// Prefer aliases which are not directly visible
|
|
4902
4903
|
SymbolFormatFlags[SymbolFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope";
|
|
4904
|
+
// { [E.A]: 1 }
|
|
4905
|
+
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["WriteComputedProps"] = 16] = "WriteComputedProps";
|
|
4903
4906
|
// Skip building an accessible symbol chain
|
|
4904
|
-
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] =
|
|
4907
|
+
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] = 32] = "DoNotIncludeSymbolChain";
|
|
4905
4908
|
})(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {}));
|
|
4906
4909
|
/* @internal */
|
|
4907
4910
|
var SymbolAccessibility;
|
|
@@ -49059,6 +49062,7 @@ var ts;
|
|
|
49059
49062
|
signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
|
|
49060
49063
|
symbolToEntityName: nodeBuilder.symbolToEntityName,
|
|
49061
49064
|
symbolToExpression: nodeBuilder.symbolToExpression,
|
|
49065
|
+
symbolToNode: nodeBuilder.symbolToNode,
|
|
49062
49066
|
symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations,
|
|
49063
49067
|
symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration,
|
|
49064
49068
|
typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration,
|
|
@@ -51714,7 +51718,7 @@ var ts;
|
|
|
51714
51718
|
}
|
|
51715
51719
|
}
|
|
51716
51720
|
function getFullyQualifiedName(symbol, containingLocation) {
|
|
51717
|
-
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined,
|
|
51721
|
+
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined, 32 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */);
|
|
51718
51722
|
}
|
|
51719
51723
|
function getContainingQualifiedNameNode(node) {
|
|
51720
51724
|
while (ts.isQualifiedName(node.parent)) {
|
|
@@ -53029,10 +53033,13 @@ var ts;
|
|
|
53029
53033
|
if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) {
|
|
53030
53034
|
nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */;
|
|
53031
53035
|
}
|
|
53032
|
-
if (flags &
|
|
53036
|
+
if (flags & 32 /* DoNotIncludeSymbolChain */) {
|
|
53033
53037
|
nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */;
|
|
53034
53038
|
}
|
|
53035
|
-
|
|
53039
|
+
if (flags & 16 /* WriteComputedProps */) {
|
|
53040
|
+
nodeFlags |= 1073741824 /* WriteComputedProps */;
|
|
53041
|
+
}
|
|
53042
|
+
var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName;
|
|
53036
53043
|
return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker);
|
|
53037
53044
|
function symbolToStringWorker(writer) {
|
|
53038
53045
|
var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217
|
|
@@ -53132,7 +53139,25 @@ var ts;
|
|
|
53132
53139
|
symbolTableToDeclarationStatements: function (symbolTable, enclosingDeclaration, flags, tracker, bundled) {
|
|
53133
53140
|
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolTableToDeclarationStatements(symbolTable, context, bundled); });
|
|
53134
53141
|
},
|
|
53142
|
+
symbolToNode: function (symbol, meaning, enclosingDeclaration, flags, tracker) {
|
|
53143
|
+
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToNode(symbol, context, meaning); });
|
|
53144
|
+
},
|
|
53135
53145
|
};
|
|
53146
|
+
function symbolToNode(symbol, context, meaning) {
|
|
53147
|
+
if (context.flags & 1073741824 /* WriteComputedProps */) {
|
|
53148
|
+
if (symbol.valueDeclaration) {
|
|
53149
|
+
var name = ts.getNameOfDeclaration(symbol.valueDeclaration);
|
|
53150
|
+
if (name && ts.isComputedPropertyName(name))
|
|
53151
|
+
return name;
|
|
53152
|
+
}
|
|
53153
|
+
var nameType = getSymbolLinks(symbol).nameType;
|
|
53154
|
+
if (nameType && nameType.flags & (1024 /* EnumLiteral */ | 8192 /* UniqueESSymbol */)) {
|
|
53155
|
+
context.enclosingDeclaration = nameType.symbol.valueDeclaration;
|
|
53156
|
+
return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, meaning));
|
|
53157
|
+
}
|
|
53158
|
+
}
|
|
53159
|
+
return symbolToExpression(symbol, context, meaning);
|
|
53160
|
+
}
|
|
53136
53161
|
function withContext(enclosingDeclaration, flags, tracker, cb) {
|
|
53137
53162
|
var _a, _b;
|
|
53138
53163
|
ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0);
|
|
@@ -65936,7 +65961,7 @@ var ts;
|
|
|
65936
65961
|
return 0 /* False */;
|
|
65937
65962
|
}
|
|
65938
65963
|
}
|
|
65939
|
-
var isPerformingCommonPropertyChecks = (relation !== comparableRelation ||
|
|
65964
|
+
var isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & 1048576 /* Union */) && isLiteralType(source)) &&
|
|
65940
65965
|
!(intersectionState & 2 /* Target */) &&
|
|
65941
65966
|
source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
|
|
65942
65967
|
target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
|
|
@@ -67315,7 +67340,7 @@ var ts;
|
|
|
67315
67340
|
shouldSkipElaboration = true; // Retain top-level error for interface implementing issues, otherwise omit it
|
|
67316
67341
|
}
|
|
67317
67342
|
if (props.length === 1) {
|
|
67318
|
-
var propName = symbolToString(unmatchedProperty);
|
|
67343
|
+
var propName = symbolToString(unmatchedProperty, /*enclosingDeclaration*/ undefined, 0 /* None */, 4 /* AllowAnyNodeKind */ | 16 /* WriteComputedProps */);
|
|
67319
67344
|
reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
|
|
67320
67345
|
if (ts.length(unmatchedProperty.declarations)) {
|
|
67321
67346
|
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
|
|
@@ -157822,11 +157847,10 @@ var ts;
|
|
|
157822
157847
|
return declaration && declaration.parent === node ? declaration : undefined;
|
|
157823
157848
|
}
|
|
157824
157849
|
function createPropertyNameFromSymbol(symbol, target, quotePreference, checker) {
|
|
157825
|
-
if (ts.isTransientSymbol(symbol)
|
|
157826
|
-
var
|
|
157827
|
-
if (
|
|
157828
|
-
return
|
|
157829
|
-
}
|
|
157850
|
+
if (ts.isTransientSymbol(symbol)) {
|
|
157851
|
+
var prop = checker.symbolToNode(symbol, 111551 /* Value */, /*enclosingDeclaration*/ undefined, 1073741824 /* WriteComputedProps */);
|
|
157852
|
+
if (prop && ts.isComputedPropertyName(prop))
|
|
157853
|
+
return prop;
|
|
157830
157854
|
}
|
|
157831
157855
|
return ts.createPropertyNameNodeForIdentifierOrLiteral(symbol.name, target, quotePreference === 0 /* Single */);
|
|
157832
157856
|
}
|
|
@@ -179629,9 +179653,9 @@ var ts;
|
|
|
179629
179653
|
};
|
|
179630
179654
|
Session.prototype.getFileAndLanguageServiceForSyntacticOperation = function (args) {
|
|
179631
179655
|
// Since this is syntactic operation, there should always be project for the file
|
|
179632
|
-
//
|
|
179656
|
+
// throw if we dont get project
|
|
179633
179657
|
var file = server.toNormalizedPath(args.file);
|
|
179634
|
-
var project = this.getProject(args.projectFileName) || this.projectService.
|
|
179658
|
+
var project = this.getProject(args.projectFileName) || this.projectService.ensureDefaultProjectForFile(file);
|
|
179635
179659
|
if (!project) {
|
|
179636
179660
|
return server.Errors.ThrowNoProject();
|
|
179637
179661
|
}
|
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 = ts.versionMajorMinor + ".0-dev.
|
|
102
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220825";
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -4831,6 +4831,7 @@ var ts;
|
|
|
4831
4831
|
NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple";
|
|
4832
4832
|
NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType";
|
|
4833
4833
|
NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType";
|
|
4834
|
+
/* @internal */ NodeBuilderFlags[NodeBuilderFlags["WriteComputedProps"] = 1073741824] = "WriteComputedProps";
|
|
4834
4835
|
// Errors (cont.)
|
|
4835
4836
|
NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths";
|
|
4836
4837
|
/* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain";
|
|
@@ -4891,8 +4892,10 @@ var ts;
|
|
|
4891
4892
|
SymbolFormatFlags[SymbolFormatFlags["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind";
|
|
4892
4893
|
// Prefer aliases which are not directly visible
|
|
4893
4894
|
SymbolFormatFlags[SymbolFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope";
|
|
4895
|
+
// { [E.A]: 1 }
|
|
4896
|
+
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["WriteComputedProps"] = 16] = "WriteComputedProps";
|
|
4894
4897
|
// Skip building an accessible symbol chain
|
|
4895
|
-
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] =
|
|
4898
|
+
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] = 32] = "DoNotIncludeSymbolChain";
|
|
4896
4899
|
})(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {}));
|
|
4897
4900
|
/* @internal */
|
|
4898
4901
|
var SymbolAccessibility;
|
|
@@ -49050,6 +49053,7 @@ var ts;
|
|
|
49050
49053
|
signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
|
|
49051
49054
|
symbolToEntityName: nodeBuilder.symbolToEntityName,
|
|
49052
49055
|
symbolToExpression: nodeBuilder.symbolToExpression,
|
|
49056
|
+
symbolToNode: nodeBuilder.symbolToNode,
|
|
49053
49057
|
symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations,
|
|
49054
49058
|
symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration,
|
|
49055
49059
|
typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration,
|
|
@@ -51705,7 +51709,7 @@ var ts;
|
|
|
51705
51709
|
}
|
|
51706
51710
|
}
|
|
51707
51711
|
function getFullyQualifiedName(symbol, containingLocation) {
|
|
51708
|
-
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined,
|
|
51712
|
+
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined, 32 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */);
|
|
51709
51713
|
}
|
|
51710
51714
|
function getContainingQualifiedNameNode(node) {
|
|
51711
51715
|
while (ts.isQualifiedName(node.parent)) {
|
|
@@ -53020,10 +53024,13 @@ var ts;
|
|
|
53020
53024
|
if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) {
|
|
53021
53025
|
nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */;
|
|
53022
53026
|
}
|
|
53023
|
-
if (flags &
|
|
53027
|
+
if (flags & 32 /* DoNotIncludeSymbolChain */) {
|
|
53024
53028
|
nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */;
|
|
53025
53029
|
}
|
|
53026
|
-
|
|
53030
|
+
if (flags & 16 /* WriteComputedProps */) {
|
|
53031
|
+
nodeFlags |= 1073741824 /* WriteComputedProps */;
|
|
53032
|
+
}
|
|
53033
|
+
var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName;
|
|
53027
53034
|
return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker);
|
|
53028
53035
|
function symbolToStringWorker(writer) {
|
|
53029
53036
|
var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217
|
|
@@ -53123,7 +53130,25 @@ var ts;
|
|
|
53123
53130
|
symbolTableToDeclarationStatements: function (symbolTable, enclosingDeclaration, flags, tracker, bundled) {
|
|
53124
53131
|
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolTableToDeclarationStatements(symbolTable, context, bundled); });
|
|
53125
53132
|
},
|
|
53133
|
+
symbolToNode: function (symbol, meaning, enclosingDeclaration, flags, tracker) {
|
|
53134
|
+
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToNode(symbol, context, meaning); });
|
|
53135
|
+
},
|
|
53126
53136
|
};
|
|
53137
|
+
function symbolToNode(symbol, context, meaning) {
|
|
53138
|
+
if (context.flags & 1073741824 /* WriteComputedProps */) {
|
|
53139
|
+
if (symbol.valueDeclaration) {
|
|
53140
|
+
var name = ts.getNameOfDeclaration(symbol.valueDeclaration);
|
|
53141
|
+
if (name && ts.isComputedPropertyName(name))
|
|
53142
|
+
return name;
|
|
53143
|
+
}
|
|
53144
|
+
var nameType = getSymbolLinks(symbol).nameType;
|
|
53145
|
+
if (nameType && nameType.flags & (1024 /* EnumLiteral */ | 8192 /* UniqueESSymbol */)) {
|
|
53146
|
+
context.enclosingDeclaration = nameType.symbol.valueDeclaration;
|
|
53147
|
+
return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, meaning));
|
|
53148
|
+
}
|
|
53149
|
+
}
|
|
53150
|
+
return symbolToExpression(symbol, context, meaning);
|
|
53151
|
+
}
|
|
53127
53152
|
function withContext(enclosingDeclaration, flags, tracker, cb) {
|
|
53128
53153
|
var _a, _b;
|
|
53129
53154
|
ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0);
|
|
@@ -65927,7 +65952,7 @@ var ts;
|
|
|
65927
65952
|
return 0 /* False */;
|
|
65928
65953
|
}
|
|
65929
65954
|
}
|
|
65930
|
-
var isPerformingCommonPropertyChecks = (relation !== comparableRelation ||
|
|
65955
|
+
var isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & 1048576 /* Union */) && isLiteralType(source)) &&
|
|
65931
65956
|
!(intersectionState & 2 /* Target */) &&
|
|
65932
65957
|
source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
|
|
65933
65958
|
target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
|
|
@@ -67306,7 +67331,7 @@ var ts;
|
|
|
67306
67331
|
shouldSkipElaboration = true; // Retain top-level error for interface implementing issues, otherwise omit it
|
|
67307
67332
|
}
|
|
67308
67333
|
if (props.length === 1) {
|
|
67309
|
-
var propName = symbolToString(unmatchedProperty);
|
|
67334
|
+
var propName = symbolToString(unmatchedProperty, /*enclosingDeclaration*/ undefined, 0 /* None */, 4 /* AllowAnyNodeKind */ | 16 /* WriteComputedProps */);
|
|
67310
67335
|
reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
|
|
67311
67336
|
if (ts.length(unmatchedProperty.declarations)) {
|
|
67312
67337
|
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
|
|
@@ -157813,11 +157838,10 @@ var ts;
|
|
|
157813
157838
|
return declaration && declaration.parent === node ? declaration : undefined;
|
|
157814
157839
|
}
|
|
157815
157840
|
function createPropertyNameFromSymbol(symbol, target, quotePreference, checker) {
|
|
157816
|
-
if (ts.isTransientSymbol(symbol)
|
|
157817
|
-
var
|
|
157818
|
-
if (
|
|
157819
|
-
return
|
|
157820
|
-
}
|
|
157841
|
+
if (ts.isTransientSymbol(symbol)) {
|
|
157842
|
+
var prop = checker.symbolToNode(symbol, 111551 /* Value */, /*enclosingDeclaration*/ undefined, 1073741824 /* WriteComputedProps */);
|
|
157843
|
+
if (prop && ts.isComputedPropertyName(prop))
|
|
157844
|
+
return prop;
|
|
157821
157845
|
}
|
|
157822
157846
|
return ts.createPropertyNameNodeForIdentifierOrLiteral(symbol.name, target, quotePreference === 0 /* Single */);
|
|
157823
157847
|
}
|
|
@@ -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 = ts.versionMajorMinor + ".0-dev.
|
|
102
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220825";
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -4831,6 +4831,7 @@ var ts;
|
|
|
4831
4831
|
NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple";
|
|
4832
4832
|
NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType";
|
|
4833
4833
|
NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType";
|
|
4834
|
+
/* @internal */ NodeBuilderFlags[NodeBuilderFlags["WriteComputedProps"] = 1073741824] = "WriteComputedProps";
|
|
4834
4835
|
// Errors (cont.)
|
|
4835
4836
|
NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths";
|
|
4836
4837
|
/* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain";
|
|
@@ -4891,8 +4892,10 @@ var ts;
|
|
|
4891
4892
|
SymbolFormatFlags[SymbolFormatFlags["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind";
|
|
4892
4893
|
// Prefer aliases which are not directly visible
|
|
4893
4894
|
SymbolFormatFlags[SymbolFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope";
|
|
4895
|
+
// { [E.A]: 1 }
|
|
4896
|
+
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["WriteComputedProps"] = 16] = "WriteComputedProps";
|
|
4894
4897
|
// Skip building an accessible symbol chain
|
|
4895
|
-
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] =
|
|
4898
|
+
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] = 32] = "DoNotIncludeSymbolChain";
|
|
4896
4899
|
})(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {}));
|
|
4897
4900
|
/* @internal */
|
|
4898
4901
|
var SymbolAccessibility;
|
|
@@ -49050,6 +49053,7 @@ var ts;
|
|
|
49050
49053
|
signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
|
|
49051
49054
|
symbolToEntityName: nodeBuilder.symbolToEntityName,
|
|
49052
49055
|
symbolToExpression: nodeBuilder.symbolToExpression,
|
|
49056
|
+
symbolToNode: nodeBuilder.symbolToNode,
|
|
49053
49057
|
symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations,
|
|
49054
49058
|
symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration,
|
|
49055
49059
|
typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration,
|
|
@@ -51705,7 +51709,7 @@ var ts;
|
|
|
51705
51709
|
}
|
|
51706
51710
|
}
|
|
51707
51711
|
function getFullyQualifiedName(symbol, containingLocation) {
|
|
51708
|
-
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined,
|
|
51712
|
+
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined, 32 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */);
|
|
51709
51713
|
}
|
|
51710
51714
|
function getContainingQualifiedNameNode(node) {
|
|
51711
51715
|
while (ts.isQualifiedName(node.parent)) {
|
|
@@ -53020,10 +53024,13 @@ var ts;
|
|
|
53020
53024
|
if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) {
|
|
53021
53025
|
nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */;
|
|
53022
53026
|
}
|
|
53023
|
-
if (flags &
|
|
53027
|
+
if (flags & 32 /* DoNotIncludeSymbolChain */) {
|
|
53024
53028
|
nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */;
|
|
53025
53029
|
}
|
|
53026
|
-
|
|
53030
|
+
if (flags & 16 /* WriteComputedProps */) {
|
|
53031
|
+
nodeFlags |= 1073741824 /* WriteComputedProps */;
|
|
53032
|
+
}
|
|
53033
|
+
var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName;
|
|
53027
53034
|
return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker);
|
|
53028
53035
|
function symbolToStringWorker(writer) {
|
|
53029
53036
|
var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217
|
|
@@ -53123,7 +53130,25 @@ var ts;
|
|
|
53123
53130
|
symbolTableToDeclarationStatements: function (symbolTable, enclosingDeclaration, flags, tracker, bundled) {
|
|
53124
53131
|
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolTableToDeclarationStatements(symbolTable, context, bundled); });
|
|
53125
53132
|
},
|
|
53133
|
+
symbolToNode: function (symbol, meaning, enclosingDeclaration, flags, tracker) {
|
|
53134
|
+
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToNode(symbol, context, meaning); });
|
|
53135
|
+
},
|
|
53126
53136
|
};
|
|
53137
|
+
function symbolToNode(symbol, context, meaning) {
|
|
53138
|
+
if (context.flags & 1073741824 /* WriteComputedProps */) {
|
|
53139
|
+
if (symbol.valueDeclaration) {
|
|
53140
|
+
var name = ts.getNameOfDeclaration(symbol.valueDeclaration);
|
|
53141
|
+
if (name && ts.isComputedPropertyName(name))
|
|
53142
|
+
return name;
|
|
53143
|
+
}
|
|
53144
|
+
var nameType = getSymbolLinks(symbol).nameType;
|
|
53145
|
+
if (nameType && nameType.flags & (1024 /* EnumLiteral */ | 8192 /* UniqueESSymbol */)) {
|
|
53146
|
+
context.enclosingDeclaration = nameType.symbol.valueDeclaration;
|
|
53147
|
+
return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, meaning));
|
|
53148
|
+
}
|
|
53149
|
+
}
|
|
53150
|
+
return symbolToExpression(symbol, context, meaning);
|
|
53151
|
+
}
|
|
53127
53152
|
function withContext(enclosingDeclaration, flags, tracker, cb) {
|
|
53128
53153
|
var _a, _b;
|
|
53129
53154
|
ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0);
|
|
@@ -65927,7 +65952,7 @@ var ts;
|
|
|
65927
65952
|
return 0 /* False */;
|
|
65928
65953
|
}
|
|
65929
65954
|
}
|
|
65930
|
-
var isPerformingCommonPropertyChecks = (relation !== comparableRelation ||
|
|
65955
|
+
var isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & 1048576 /* Union */) && isLiteralType(source)) &&
|
|
65931
65956
|
!(intersectionState & 2 /* Target */) &&
|
|
65932
65957
|
source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
|
|
65933
65958
|
target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
|
|
@@ -67306,7 +67331,7 @@ var ts;
|
|
|
67306
67331
|
shouldSkipElaboration = true; // Retain top-level error for interface implementing issues, otherwise omit it
|
|
67307
67332
|
}
|
|
67308
67333
|
if (props.length === 1) {
|
|
67309
|
-
var propName = symbolToString(unmatchedProperty);
|
|
67334
|
+
var propName = symbolToString(unmatchedProperty, /*enclosingDeclaration*/ undefined, 0 /* None */, 4 /* AllowAnyNodeKind */ | 16 /* WriteComputedProps */);
|
|
67310
67335
|
reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
|
|
67311
67336
|
if (ts.length(unmatchedProperty.declarations)) {
|
|
67312
67337
|
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
|
|
@@ -157813,11 +157838,10 @@ var ts;
|
|
|
157813
157838
|
return declaration && declaration.parent === node ? declaration : undefined;
|
|
157814
157839
|
}
|
|
157815
157840
|
function createPropertyNameFromSymbol(symbol, target, quotePreference, checker) {
|
|
157816
|
-
if (ts.isTransientSymbol(symbol)
|
|
157817
|
-
var
|
|
157818
|
-
if (
|
|
157819
|
-
return
|
|
157820
|
-
}
|
|
157841
|
+
if (ts.isTransientSymbol(symbol)) {
|
|
157842
|
+
var prop = checker.symbolToNode(symbol, 111551 /* Value */, /*enclosingDeclaration*/ undefined, 1073741824 /* WriteComputedProps */);
|
|
157843
|
+
if (prop && ts.isComputedPropertyName(prop))
|
|
157844
|
+
return prop;
|
|
157821
157845
|
}
|
|
157822
157846
|
return ts.createPropertyNameNodeForIdentifierOrLiteral(symbol.name, target, quotePreference === 0 /* Single */);
|
|
157823
157847
|
}
|
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.20220825";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -4821,6 +4821,7 @@ var ts;
|
|
|
4821
4821
|
NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple";
|
|
4822
4822
|
NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType";
|
|
4823
4823
|
NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType";
|
|
4824
|
+
/* @internal */ NodeBuilderFlags[NodeBuilderFlags["WriteComputedProps"] = 1073741824] = "WriteComputedProps";
|
|
4824
4825
|
// Errors (cont.)
|
|
4825
4826
|
NodeBuilderFlags[NodeBuilderFlags["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths";
|
|
4826
4827
|
/* @internal */ NodeBuilderFlags[NodeBuilderFlags["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain";
|
|
@@ -4881,8 +4882,10 @@ var ts;
|
|
|
4881
4882
|
SymbolFormatFlags[SymbolFormatFlags["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind";
|
|
4882
4883
|
// Prefer aliases which are not directly visible
|
|
4883
4884
|
SymbolFormatFlags[SymbolFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope";
|
|
4885
|
+
// { [E.A]: 1 }
|
|
4886
|
+
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["WriteComputedProps"] = 16] = "WriteComputedProps";
|
|
4884
4887
|
// Skip building an accessible symbol chain
|
|
4885
|
-
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] =
|
|
4888
|
+
/* @internal */ SymbolFormatFlags[SymbolFormatFlags["DoNotIncludeSymbolChain"] = 32] = "DoNotIncludeSymbolChain";
|
|
4886
4889
|
})(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {}));
|
|
4887
4890
|
/* @internal */
|
|
4888
4891
|
var SymbolAccessibility;
|
|
@@ -49040,6 +49043,7 @@ var ts;
|
|
|
49040
49043
|
signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
|
|
49041
49044
|
symbolToEntityName: nodeBuilder.symbolToEntityName,
|
|
49042
49045
|
symbolToExpression: nodeBuilder.symbolToExpression,
|
|
49046
|
+
symbolToNode: nodeBuilder.symbolToNode,
|
|
49043
49047
|
symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations,
|
|
49044
49048
|
symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration,
|
|
49045
49049
|
typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration,
|
|
@@ -51695,7 +51699,7 @@ var ts;
|
|
|
51695
51699
|
}
|
|
51696
51700
|
}
|
|
51697
51701
|
function getFullyQualifiedName(symbol, containingLocation) {
|
|
51698
|
-
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined,
|
|
51702
|
+
return symbol.parent ? getFullyQualifiedName(symbol.parent, containingLocation) + "." + symbolToString(symbol) : symbolToString(symbol, containingLocation, /*meaning*/ undefined, 32 /* DoNotIncludeSymbolChain */ | 4 /* AllowAnyNodeKind */);
|
|
51699
51703
|
}
|
|
51700
51704
|
function getContainingQualifiedNameNode(node) {
|
|
51701
51705
|
while (ts.isQualifiedName(node.parent)) {
|
|
@@ -53010,10 +53014,13 @@ var ts;
|
|
|
53010
53014
|
if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) {
|
|
53011
53015
|
nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */;
|
|
53012
53016
|
}
|
|
53013
|
-
if (flags &
|
|
53017
|
+
if (flags & 32 /* DoNotIncludeSymbolChain */) {
|
|
53014
53018
|
nodeFlags |= 134217728 /* DoNotIncludeSymbolChain */;
|
|
53015
53019
|
}
|
|
53016
|
-
|
|
53020
|
+
if (flags & 16 /* WriteComputedProps */) {
|
|
53021
|
+
nodeFlags |= 1073741824 /* WriteComputedProps */;
|
|
53022
|
+
}
|
|
53023
|
+
var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName;
|
|
53017
53024
|
return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker);
|
|
53018
53025
|
function symbolToStringWorker(writer) {
|
|
53019
53026
|
var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); // TODO: GH#18217
|
|
@@ -53113,7 +53120,25 @@ var ts;
|
|
|
53113
53120
|
symbolTableToDeclarationStatements: function (symbolTable, enclosingDeclaration, flags, tracker, bundled) {
|
|
53114
53121
|
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolTableToDeclarationStatements(symbolTable, context, bundled); });
|
|
53115
53122
|
},
|
|
53123
|
+
symbolToNode: function (symbol, meaning, enclosingDeclaration, flags, tracker) {
|
|
53124
|
+
return withContext(enclosingDeclaration, flags, tracker, function (context) { return symbolToNode(symbol, context, meaning); });
|
|
53125
|
+
},
|
|
53116
53126
|
};
|
|
53127
|
+
function symbolToNode(symbol, context, meaning) {
|
|
53128
|
+
if (context.flags & 1073741824 /* WriteComputedProps */) {
|
|
53129
|
+
if (symbol.valueDeclaration) {
|
|
53130
|
+
var name = ts.getNameOfDeclaration(symbol.valueDeclaration);
|
|
53131
|
+
if (name && ts.isComputedPropertyName(name))
|
|
53132
|
+
return name;
|
|
53133
|
+
}
|
|
53134
|
+
var nameType = getSymbolLinks(symbol).nameType;
|
|
53135
|
+
if (nameType && nameType.flags & (1024 /* EnumLiteral */ | 8192 /* UniqueESSymbol */)) {
|
|
53136
|
+
context.enclosingDeclaration = nameType.symbol.valueDeclaration;
|
|
53137
|
+
return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, meaning));
|
|
53138
|
+
}
|
|
53139
|
+
}
|
|
53140
|
+
return symbolToExpression(symbol, context, meaning);
|
|
53141
|
+
}
|
|
53117
53142
|
function withContext(enclosingDeclaration, flags, tracker, cb) {
|
|
53118
53143
|
var _a, _b;
|
|
53119
53144
|
ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0);
|
|
@@ -65917,7 +65942,7 @@ var ts;
|
|
|
65917
65942
|
return 0 /* False */;
|
|
65918
65943
|
}
|
|
65919
65944
|
}
|
|
65920
|
-
var isPerformingCommonPropertyChecks = (relation !== comparableRelation ||
|
|
65945
|
+
var isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & 1048576 /* Union */) && isLiteralType(source)) &&
|
|
65921
65946
|
!(intersectionState & 2 /* Target */) &&
|
|
65922
65947
|
source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
|
|
65923
65948
|
target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
|
|
@@ -67296,7 +67321,7 @@ var ts;
|
|
|
67296
67321
|
shouldSkipElaboration = true; // Retain top-level error for interface implementing issues, otherwise omit it
|
|
67297
67322
|
}
|
|
67298
67323
|
if (props.length === 1) {
|
|
67299
|
-
var propName = symbolToString(unmatchedProperty);
|
|
67324
|
+
var propName = symbolToString(unmatchedProperty, /*enclosingDeclaration*/ undefined, 0 /* None */, 4 /* AllowAnyNodeKind */ | 16 /* WriteComputedProps */);
|
|
67300
67325
|
reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
|
|
67301
67326
|
if (ts.length(unmatchedProperty.declarations)) {
|
|
67302
67327
|
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
|
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.0-dev.
|
|
5
|
+
"version": "4.9.0-dev.20220825",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|