@typescript-deploys/pr-build 4.6.0-pr-47550-2 → 4.6.0-pr-47607-13
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/fr/diagnosticMessages.generated.json +17 -4
- package/lib/ja/diagnosticMessages.generated.json +17 -4
- package/lib/ko/diagnosticMessages.generated.json +17 -4
- package/lib/lib.dom.d.ts +73 -1
- package/lib/lib.dom.iterable.d.ts +4 -0
- package/lib/lib.webworker.d.ts +48 -0
- package/lib/pl/diagnosticMessages.generated.json +17 -4
- package/lib/ru/diagnosticMessages.generated.json +17 -4
- package/lib/tr/diagnosticMessages.generated.json +17 -4
- package/lib/tsc.js +326 -192
- package/lib/tsserver.js +640 -302
- package/lib/tsserverlibrary.d.ts +16 -12
- package/lib/tsserverlibrary.js +640 -302
- package/lib/typescript.d.ts +16 -12
- package/lib/typescript.js +640 -302
- package/lib/typescriptServices.d.ts +16 -12
- package/lib/typescriptServices.js +640 -302
- package/lib/typingsInstaller.js +345 -221
- package/lib/zh-tw/diagnosticMessages.generated.json +17 -4
- 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-insiders.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220127";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -100,13 +100,18 @@ var ts;
|
|
|
100
100
|
/* @internal */
|
|
101
101
|
var NativeCollections;
|
|
102
102
|
(function (NativeCollections) {
|
|
103
|
+
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
104
|
+
typeof global !== "undefined" ? global :
|
|
105
|
+
typeof self !== "undefined" ? self :
|
|
106
|
+
undefined;
|
|
103
107
|
/**
|
|
104
108
|
* Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
|
|
105
109
|
*/
|
|
106
110
|
function tryGetNativeMap() {
|
|
107
111
|
// Internet Explorer's Map doesn't support iteration, so don't use it.
|
|
112
|
+
var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
|
|
108
113
|
// eslint-disable-next-line no-in-operator
|
|
109
|
-
return typeof
|
|
114
|
+
return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
|
|
110
115
|
}
|
|
111
116
|
NativeCollections.tryGetNativeMap = tryGetNativeMap;
|
|
112
117
|
/**
|
|
@@ -114,8 +119,9 @@ var ts;
|
|
|
114
119
|
*/
|
|
115
120
|
function tryGetNativeSet() {
|
|
116
121
|
// Internet Explorer's Set doesn't support iteration, so don't use it.
|
|
122
|
+
var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
|
|
117
123
|
// eslint-disable-next-line no-in-operator
|
|
118
|
-
return typeof
|
|
124
|
+
return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
|
|
119
125
|
}
|
|
120
126
|
NativeCollections.tryGetNativeSet = tryGetNativeSet;
|
|
121
127
|
})(NativeCollections || (NativeCollections = {}));
|
|
@@ -4901,13 +4907,14 @@ var ts;
|
|
|
4901
4907
|
// Flags that require TypeFlags.Object
|
|
4902
4908
|
ObjectFlags[ObjectFlags["ContainsSpread"] = 4194304] = "ContainsSpread";
|
|
4903
4909
|
ObjectFlags[ObjectFlags["ObjectRestType"] = 8388608] = "ObjectRestType";
|
|
4910
|
+
ObjectFlags[ObjectFlags["InstantiationExpressionType"] = 16777216] = "InstantiationExpressionType";
|
|
4904
4911
|
/* @internal */
|
|
4905
|
-
ObjectFlags[ObjectFlags["IsClassInstanceClone"] =
|
|
4912
|
+
ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 33554432] = "IsClassInstanceClone";
|
|
4906
4913
|
// Flags that require TypeFlags.Object and ObjectFlags.Reference
|
|
4907
4914
|
/* @internal */
|
|
4908
|
-
ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] =
|
|
4915
|
+
ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] = 67108864] = "IdenticalBaseTypeCalculated";
|
|
4909
4916
|
/* @internal */
|
|
4910
|
-
ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] =
|
|
4917
|
+
ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] = 134217728] = "IdenticalBaseTypeExists";
|
|
4911
4918
|
// Flags that require TypeFlags.UnionOrIntersection or TypeFlags.Substitution
|
|
4912
4919
|
/* @internal */
|
|
4913
4920
|
ObjectFlags[ObjectFlags["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
|
|
@@ -8513,6 +8520,7 @@ var ts;
|
|
|
8513
8520
|
Cannot_assign_to_0_because_it_is_an_import: diag(2632, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_an_import_2632", "Cannot assign to '{0}' because it is an import."),
|
|
8514
8521
|
JSX_property_access_expressions_cannot_include_JSX_namespace_names: diag(2633, ts.DiagnosticCategory.Error, "JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633", "JSX property access expressions cannot include JSX namespace names"),
|
|
8515
8522
|
_0_index_signatures_are_incompatible: diag(2634, ts.DiagnosticCategory.Error, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."),
|
|
8523
|
+
Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: diag(2635, ts.DiagnosticCategory.Error, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."),
|
|
8516
8524
|
Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
|
|
8517
8525
|
A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
|
|
8518
8526
|
Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
|
|
@@ -9456,6 +9464,8 @@ var ts;
|
|
|
9456
9464
|
Remove_unused_declarations_for_Colon_0: diag(90041, ts.DiagnosticCategory.Message, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"),
|
|
9457
9465
|
Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."),
|
|
9458
9466
|
Includes_imports_of_types_referenced_by_0: diag(90054, ts.DiagnosticCategory.Message, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"),
|
|
9467
|
+
Remove_type_from_import_declaration_from_0: diag(90055, ts.DiagnosticCategory.Message, "Remove_type_from_import_declaration_from_0_90055", "Remove 'type' from import declaration from \"{0}\""),
|
|
9468
|
+
Remove_type_from_import_of_0_from_1: diag(90056, ts.DiagnosticCategory.Message, "Remove_type_from_import_of_0_from_1_90056", "Remove 'type' from import of '{0}' from \"{1}\""),
|
|
9459
9469
|
Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
9460
9470
|
Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
9461
9471
|
Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -13396,6 +13406,7 @@ var ts;
|
|
|
13396
13406
|
case 110 /* TrueKeyword */:
|
|
13397
13407
|
case 106 /* SuperKeyword */:
|
|
13398
13408
|
case 229 /* NonNullExpression */:
|
|
13409
|
+
case 227 /* ExpressionWithTypeArguments */:
|
|
13399
13410
|
case 230 /* MetaProperty */:
|
|
13400
13411
|
case 100 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression
|
|
13401
13412
|
return true;
|
|
@@ -14046,10 +14057,13 @@ var ts;
|
|
|
14046
14057
|
function packageIdIsEqual(a, b) {
|
|
14047
14058
|
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
14048
14059
|
}
|
|
14049
|
-
function
|
|
14050
|
-
var name = _a.name, subModuleName = _a.subModuleName
|
|
14051
|
-
|
|
14052
|
-
|
|
14060
|
+
function packageIdToPackageName(_a) {
|
|
14061
|
+
var name = _a.name, subModuleName = _a.subModuleName;
|
|
14062
|
+
return subModuleName ? name + "/" + subModuleName : name;
|
|
14063
|
+
}
|
|
14064
|
+
ts.packageIdToPackageName = packageIdToPackageName;
|
|
14065
|
+
function packageIdToString(packageId) {
|
|
14066
|
+
return packageIdToPackageName(packageId) + "@" + packageId.version;
|
|
14053
14067
|
}
|
|
14054
14068
|
ts.packageIdToString = packageIdToString;
|
|
14055
14069
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -14882,6 +14896,15 @@ var ts;
|
|
|
14882
14896
|
};
|
|
14883
14897
|
}
|
|
14884
14898
|
ts.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain;
|
|
14899
|
+
function createDiagnosticMessageChainFromDiagnostic(diagnostic) {
|
|
14900
|
+
return typeof diagnostic.messageText === "string" ? {
|
|
14901
|
+
code: diagnostic.code,
|
|
14902
|
+
category: diagnostic.category,
|
|
14903
|
+
messageText: diagnostic.messageText,
|
|
14904
|
+
next: diagnostic.next,
|
|
14905
|
+
} : diagnostic.messageText;
|
|
14906
|
+
}
|
|
14907
|
+
ts.createDiagnosticMessageChainFromDiagnostic = createDiagnosticMessageChainFromDiagnostic;
|
|
14885
14908
|
function createDiagnosticForRange(sourceFile, range, message) {
|
|
14886
14909
|
return {
|
|
14887
14910
|
file: sourceFile,
|
|
@@ -15050,7 +15073,8 @@ var ts;
|
|
|
15050
15073
|
node.kind === 212 /* FunctionExpression */ ||
|
|
15051
15074
|
node.kind === 213 /* ArrowFunction */ ||
|
|
15052
15075
|
node.kind === 211 /* ParenthesizedExpression */ ||
|
|
15053
|
-
node.kind === 253 /* VariableDeclaration */
|
|
15076
|
+
node.kind === 253 /* VariableDeclaration */ ||
|
|
15077
|
+
node.kind === 274 /* ExportSpecifier */) ?
|
|
15054
15078
|
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
|
|
15055
15079
|
ts.getLeadingCommentRanges(text, node.pos);
|
|
15056
15080
|
// True if the comment starts with '/**' but not if it is '/**/'
|
|
@@ -15084,7 +15108,7 @@ var ts;
|
|
|
15084
15108
|
case 114 /* VoidKeyword */:
|
|
15085
15109
|
return node.parent.kind !== 216 /* VoidExpression */;
|
|
15086
15110
|
case 227 /* ExpressionWithTypeArguments */:
|
|
15087
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
15111
|
+
return ts.isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
15088
15112
|
case 162 /* TypeParameter */:
|
|
15089
15113
|
return node.parent.kind === 194 /* MappedType */ || node.parent.kind === 189 /* InferType */;
|
|
15090
15114
|
// Identifiers and qualified names may be type nodes, depending on their context. Climb
|
|
@@ -15121,7 +15145,7 @@ var ts;
|
|
|
15121
15145
|
}
|
|
15122
15146
|
switch (parent.kind) {
|
|
15123
15147
|
case 227 /* ExpressionWithTypeArguments */:
|
|
15124
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
15148
|
+
return ts.isHeritageClause(parent.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
15125
15149
|
case 162 /* TypeParameter */:
|
|
15126
15150
|
return node === parent.constraint;
|
|
15127
15151
|
case 342 /* JSDocTemplateTag */:
|
|
@@ -15824,7 +15848,7 @@ var ts;
|
|
|
15824
15848
|
case 296 /* SpreadAssignment */:
|
|
15825
15849
|
return true;
|
|
15826
15850
|
case 227 /* ExpressionWithTypeArguments */:
|
|
15827
|
-
return parent.expression === node &&
|
|
15851
|
+
return parent.expression === node && !isPartOfTypeNode(parent);
|
|
15828
15852
|
case 295 /* ShorthandPropertyAssignment */:
|
|
15829
15853
|
return parent.objectAssignmentInitializer === node;
|
|
15830
15854
|
default:
|
|
@@ -22758,16 +22782,18 @@ var ts;
|
|
|
22758
22782
|
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
|
|
22759
22783
|
}
|
|
22760
22784
|
// @api
|
|
22761
|
-
function createTypeQueryNode(exprName) {
|
|
22785
|
+
function createTypeQueryNode(exprName, typeArguments) {
|
|
22762
22786
|
var node = createBaseNode(180 /* TypeQuery */);
|
|
22763
22787
|
node.exprName = exprName;
|
|
22788
|
+
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
22764
22789
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22765
22790
|
return node;
|
|
22766
22791
|
}
|
|
22767
22792
|
// @api
|
|
22768
|
-
function updateTypeQueryNode(node, exprName) {
|
|
22793
|
+
function updateTypeQueryNode(node, exprName, typeArguments) {
|
|
22769
22794
|
return node.exprName !== exprName
|
|
22770
|
-
|
|
22795
|
+
|| node.typeArguments !== typeArguments
|
|
22796
|
+
? update(createTypeQueryNode(exprName, typeArguments), node)
|
|
22771
22797
|
: node;
|
|
22772
22798
|
}
|
|
22773
22799
|
// @api
|
|
@@ -29883,7 +29909,8 @@ var ts;
|
|
|
29883
29909
|
visitNode(cbNode, node.parameterName) ||
|
|
29884
29910
|
visitNode(cbNode, node.type);
|
|
29885
29911
|
case 180 /* TypeQuery */:
|
|
29886
|
-
return visitNode(cbNode, node.exprName)
|
|
29912
|
+
return visitNode(cbNode, node.exprName) ||
|
|
29913
|
+
visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
29887
29914
|
case 181 /* TypeLiteral */:
|
|
29888
29915
|
return visitNodes(cbNode, cbNodes, node.members);
|
|
29889
29916
|
case 182 /* ArrayType */:
|
|
@@ -32416,7 +32443,9 @@ var ts;
|
|
|
32416
32443
|
function parseTypeQuery() {
|
|
32417
32444
|
var pos = getNodePos();
|
|
32418
32445
|
parseExpected(112 /* TypeOfKeyword */);
|
|
32419
|
-
|
|
32446
|
+
var entityName = parseEntityName(/*allowReservedWords*/ true);
|
|
32447
|
+
var typeArguments = tryParseTypeArguments();
|
|
32448
|
+
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
32420
32449
|
}
|
|
32421
32450
|
function parseTypeParameter() {
|
|
32422
32451
|
var pos = getNodePos();
|
|
@@ -33355,7 +33384,7 @@ var ts;
|
|
|
33355
33384
|
function parseInitializer() {
|
|
33356
33385
|
return parseOptional(63 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined;
|
|
33357
33386
|
}
|
|
33358
|
-
function parseAssignmentExpressionOrHigher(
|
|
33387
|
+
function parseAssignmentExpressionOrHigher() {
|
|
33359
33388
|
// AssignmentExpression[in,yield]:
|
|
33360
33389
|
// 1) ConditionalExpression[?in,?yield]
|
|
33361
33390
|
// 2) LeftHandSideExpression = AssignmentExpression[?in,?yield]
|
|
@@ -33381,7 +33410,7 @@ var ts;
|
|
|
33381
33410
|
// If we do successfully parse arrow-function, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is
|
|
33382
33411
|
// not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done
|
|
33383
33412
|
// with AssignmentExpression if we see one.
|
|
33384
|
-
var arrowExpression = tryParseParenthesizedArrowFunctionExpression(
|
|
33413
|
+
var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();
|
|
33385
33414
|
if (arrowExpression) {
|
|
33386
33415
|
return arrowExpression;
|
|
33387
33416
|
}
|
|
@@ -33400,7 +33429,7 @@ var ts;
|
|
|
33400
33429
|
// parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single
|
|
33401
33430
|
// identifier and the current token is an arrow.
|
|
33402
33431
|
if (expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) {
|
|
33403
|
-
return parseSimpleArrowFunctionExpression(pos, expr, /*asyncModifier*/ undefined
|
|
33432
|
+
return parseSimpleArrowFunctionExpression(pos, expr, /*asyncModifier*/ undefined);
|
|
33404
33433
|
}
|
|
33405
33434
|
// Now see if we might be in cases '2' or '3'.
|
|
33406
33435
|
// If the expression was a LHS expression, and we have an assignment operator, then
|
|
@@ -33460,7 +33489,7 @@ var ts;
|
|
|
33460
33489
|
return finishNode(factory.createYieldExpression(/*asteriskToken*/ undefined, /*expression*/ undefined), pos);
|
|
33461
33490
|
}
|
|
33462
33491
|
}
|
|
33463
|
-
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier
|
|
33492
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {
|
|
33464
33493
|
ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
33465
33494
|
var parameter = factory.createParameterDeclaration(
|
|
33466
33495
|
/*decorators*/ undefined,
|
|
@@ -33472,11 +33501,11 @@ var ts;
|
|
|
33472
33501
|
finishNode(parameter, identifier.pos);
|
|
33473
33502
|
var parameters = createNodeArray([parameter], parameter.pos, parameter.end);
|
|
33474
33503
|
var equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */);
|
|
33475
|
-
var body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier
|
|
33504
|
+
var body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier);
|
|
33476
33505
|
var node = factory.createArrowFunction(asyncModifier, /*typeParameters*/ undefined, parameters, /*type*/ undefined, equalsGreaterThanToken, body);
|
|
33477
33506
|
return addJSDocComment(finishNode(node, pos));
|
|
33478
33507
|
}
|
|
33479
|
-
function tryParseParenthesizedArrowFunctionExpression(
|
|
33508
|
+
function tryParseParenthesizedArrowFunctionExpression() {
|
|
33480
33509
|
var triState = isParenthesizedArrowFunctionExpression();
|
|
33481
33510
|
if (triState === 0 /* False */) {
|
|
33482
33511
|
// It's definitely not a parenthesized arrow function expression.
|
|
@@ -33487,8 +33516,8 @@ var ts;
|
|
|
33487
33516
|
// it out, but don't allow any ambiguity, and return 'undefined' if this could be an
|
|
33488
33517
|
// expression instead.
|
|
33489
33518
|
return triState === 1 /* True */ ?
|
|
33490
|
-
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true
|
|
33491
|
-
tryParse(
|
|
33519
|
+
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true) :
|
|
33520
|
+
tryParse(parsePossibleParenthesizedArrowFunctionExpression);
|
|
33492
33521
|
}
|
|
33493
33522
|
// True -> We definitely expect a parenthesized arrow function here.
|
|
33494
33523
|
// False -> There *cannot* be a parenthesized arrow function here.
|
|
@@ -33618,25 +33647,25 @@ var ts;
|
|
|
33618
33647
|
return 2 /* Unknown */;
|
|
33619
33648
|
}
|
|
33620
33649
|
}
|
|
33621
|
-
function parsePossibleParenthesizedArrowFunctionExpression(
|
|
33650
|
+
function parsePossibleParenthesizedArrowFunctionExpression() {
|
|
33622
33651
|
var tokenPos = scanner.getTokenPos();
|
|
33623
33652
|
if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) {
|
|
33624
33653
|
return undefined;
|
|
33625
33654
|
}
|
|
33626
|
-
var result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false
|
|
33655
|
+
var result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false);
|
|
33627
33656
|
if (!result) {
|
|
33628
33657
|
(notParenthesizedArrow || (notParenthesizedArrow = new ts.Set())).add(tokenPos);
|
|
33629
33658
|
}
|
|
33630
33659
|
return result;
|
|
33631
33660
|
}
|
|
33632
|
-
function tryParseAsyncSimpleArrowFunctionExpression(
|
|
33661
|
+
function tryParseAsyncSimpleArrowFunctionExpression() {
|
|
33633
33662
|
// We do a check here so that we won't be doing unnecessarily call to "lookAhead"
|
|
33634
33663
|
if (token() === 131 /* AsyncKeyword */) {
|
|
33635
33664
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
|
|
33636
33665
|
var pos = getNodePos();
|
|
33637
33666
|
var asyncModifier = parseModifiersForArrowFunction();
|
|
33638
33667
|
var expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
33639
|
-
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier
|
|
33668
|
+
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier);
|
|
33640
33669
|
}
|
|
33641
33670
|
}
|
|
33642
33671
|
return undefined;
|
|
@@ -33660,7 +33689,7 @@ var ts;
|
|
|
33660
33689
|
}
|
|
33661
33690
|
return 0 /* False */;
|
|
33662
33691
|
}
|
|
33663
|
-
function parseParenthesizedArrowFunctionExpression(allowAmbiguity
|
|
33692
|
+
function parseParenthesizedArrowFunctionExpression(allowAmbiguity) {
|
|
33664
33693
|
var pos = getNodePos();
|
|
33665
33694
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
33666
33695
|
var modifiers = parseModifiersForArrowFunction();
|
|
@@ -33686,18 +33715,6 @@ var ts;
|
|
|
33686
33715
|
return undefined;
|
|
33687
33716
|
}
|
|
33688
33717
|
}
|
|
33689
|
-
// Given:
|
|
33690
|
-
// x ? y => ({ y }) : z => ({ z })
|
|
33691
|
-
// We try to parse the body of the first arrow function by looking at:
|
|
33692
|
-
// ({ y }) : z => ({ z })
|
|
33693
|
-
// This is a valid arrow function with "z" as the return type.
|
|
33694
|
-
//
|
|
33695
|
-
// But, if we're in the true side of a conditional expression, this colon
|
|
33696
|
-
// terminates the true side, so cannot be the return type.
|
|
33697
|
-
if (parsingConditionalTrueSide && token() === 58 /* ColonToken */) {
|
|
33698
|
-
ts.Debug.assert(!allowAmbiguity);
|
|
33699
|
-
return undefined;
|
|
33700
|
-
}
|
|
33701
33718
|
var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);
|
|
33702
33719
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
33703
33720
|
return undefined;
|
|
@@ -33731,7 +33748,7 @@ var ts;
|
|
|
33731
33748
|
var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
|
|
33732
33749
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
33733
33750
|
}
|
|
33734
|
-
function parseArrowFunctionExpressionBody(isAsync
|
|
33751
|
+
function parseArrowFunctionExpressionBody(isAsync) {
|
|
33735
33752
|
if (token() === 18 /* OpenBraceToken */) {
|
|
33736
33753
|
return parseFunctionBlock(isAsync ? 2 /* Await */ : 0 /* None */);
|
|
33737
33754
|
}
|
|
@@ -33759,8 +33776,8 @@ var ts;
|
|
|
33759
33776
|
var savedTopLevel = topLevel;
|
|
33760
33777
|
topLevel = false;
|
|
33761
33778
|
var node = isAsync
|
|
33762
|
-
? doInAwaitContext(
|
|
33763
|
-
: doOutsideOfAwaitContext(
|
|
33779
|
+
? doInAwaitContext(parseAssignmentExpressionOrHigher)
|
|
33780
|
+
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
|
|
33764
33781
|
topLevel = savedTopLevel;
|
|
33765
33782
|
return node;
|
|
33766
33783
|
}
|
|
@@ -33773,8 +33790,8 @@ var ts;
|
|
|
33773
33790
|
// Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and
|
|
33774
33791
|
// we do not that for the 'whenFalse' part.
|
|
33775
33792
|
var colonToken;
|
|
33776
|
-
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext,
|
|
33777
|
-
? parseAssignmentExpressionOrHigher(
|
|
33793
|
+
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58 /* ColonToken */), ts.nodeIsPresent(colonToken)
|
|
33794
|
+
? parseAssignmentExpressionOrHigher()
|
|
33778
33795
|
: createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(58 /* ColonToken */))), pos);
|
|
33779
33796
|
}
|
|
33780
33797
|
function parseBinaryExpressionOrHigher(precedence) {
|
|
@@ -34545,12 +34562,16 @@ var ts;
|
|
|
34545
34562
|
expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
|
|
34546
34563
|
continue;
|
|
34547
34564
|
}
|
|
34548
|
-
|
|
34549
|
-
|
|
34550
|
-
|
|
34551
|
-
|
|
34552
|
-
|
|
34553
|
-
|
|
34565
|
+
if (questionDotToken || token() === 20 /* OpenParenToken */) {
|
|
34566
|
+
var argumentList = parseArgumentList();
|
|
34567
|
+
var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
34568
|
+
factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
|
|
34569
|
+
factory.createCallExpression(expression, typeArguments, argumentList);
|
|
34570
|
+
expression = finishNode(callExpr, pos);
|
|
34571
|
+
continue;
|
|
34572
|
+
}
|
|
34573
|
+
expression = finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
34574
|
+
break;
|
|
34554
34575
|
}
|
|
34555
34576
|
}
|
|
34556
34577
|
else if (token() === 20 /* OpenParenToken */) {
|
|
@@ -34590,20 +34611,23 @@ var ts;
|
|
|
34590
34611
|
// If it doesn't have the closing `>` then it's definitely not an type argument list.
|
|
34591
34612
|
return undefined;
|
|
34592
34613
|
}
|
|
34593
|
-
//
|
|
34594
|
-
//
|
|
34595
|
-
|
|
34596
|
-
|
|
34597
|
-
|
|
34614
|
+
// We successfully parsed a type argument list. The next token determines whether we want to
|
|
34615
|
+
// treat it as such. If the type argument list is followed by `(` or a template literal, as in
|
|
34616
|
+
// `f<number>(42)`, we favor the type argument interpretation even though JavaScript would view
|
|
34617
|
+
// it as a relational expression.
|
|
34618
|
+
return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined;
|
|
34598
34619
|
}
|
|
34599
34620
|
function canFollowTypeArgumentsInExpression() {
|
|
34600
34621
|
switch (token()) {
|
|
34622
|
+
// These tokens can follow a type argument list in a call expression.
|
|
34601
34623
|
case 20 /* OpenParenToken */: // foo<x>(
|
|
34602
34624
|
case 14 /* NoSubstitutionTemplateLiteral */: // foo<T> `...`
|
|
34603
34625
|
case 15 /* TemplateHead */: // foo<T> `...${100}...`
|
|
34604
|
-
//
|
|
34605
|
-
//
|
|
34626
|
+
// These tokens can't follow in a call expression, nor can they start an
|
|
34627
|
+
// expression. So, consider the type argument list part of an instantiation
|
|
34628
|
+
// expression.
|
|
34606
34629
|
// falls through
|
|
34630
|
+
case 27 /* CommaToken */: // foo<x>,
|
|
34607
34631
|
case 24 /* DotToken */: // foo<x>.
|
|
34608
34632
|
case 21 /* CloseParenToken */: // foo<x>)
|
|
34609
34633
|
case 23 /* CloseBracketToken */: // foo<x>]
|
|
@@ -34622,20 +34646,10 @@ var ts;
|
|
|
34622
34646
|
case 51 /* BarToken */: // foo<x> |
|
|
34623
34647
|
case 19 /* CloseBraceToken */: // foo<x> }
|
|
34624
34648
|
case 1 /* EndOfFileToken */: // foo<x>
|
|
34625
|
-
// these cases can't legally follow a type arg list. However, they're not legal
|
|
34626
|
-
// expressions either. The user is probably in the middle of a generic type. So
|
|
34627
|
-
// treat it as such.
|
|
34628
34649
|
return true;
|
|
34629
|
-
case 27 /* CommaToken */: // foo<x>,
|
|
34630
|
-
case 18 /* OpenBraceToken */: // foo<x> {
|
|
34631
|
-
// We don't want to treat these as type arguments. Otherwise we'll parse this
|
|
34632
|
-
// as an invocation expression. Instead, we want to parse out the expression
|
|
34633
|
-
// in isolation from the type arguments.
|
|
34634
|
-
// falls through
|
|
34635
|
-
default:
|
|
34636
|
-
// Anything else treat as an expression.
|
|
34637
|
-
return false;
|
|
34638
34650
|
}
|
|
34651
|
+
// Treat anything else as an expression.
|
|
34652
|
+
return false;
|
|
34639
34653
|
}
|
|
34640
34654
|
function parsePrimaryExpression() {
|
|
34641
34655
|
switch (token()) {
|
|
@@ -34816,17 +34830,12 @@ var ts;
|
|
|
34816
34830
|
return finishNode(factory.createMetaProperty(103 /* NewKeyword */, name), pos);
|
|
34817
34831
|
}
|
|
34818
34832
|
var expressionPos = getNodePos();
|
|
34819
|
-
var expression = parsePrimaryExpression();
|
|
34820
|
-
var typeArguments;
|
|
34821
|
-
|
|
34822
|
-
|
|
34823
|
-
|
|
34824
|
-
|
|
34825
|
-
ts.Debug.assert(!!typeArguments, "Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'");
|
|
34826
|
-
expression = parseTaggedTemplateRest(expressionPos, expression, /*optionalChain*/ undefined, typeArguments);
|
|
34827
|
-
typeArguments = undefined;
|
|
34828
|
-
}
|
|
34829
|
-
break;
|
|
34833
|
+
var expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), /*allowOptionalChain*/ false);
|
|
34834
|
+
var typeArguments = tryParse(parseTypeArgumentsInExpression);
|
|
34835
|
+
if (isTemplateStartOfTaggedTemplate()) {
|
|
34836
|
+
ts.Debug.assert(!!typeArguments, "Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'");
|
|
34837
|
+
expression = parseTaggedTemplateRest(expressionPos, expression, /*optionalChain*/ undefined, typeArguments);
|
|
34838
|
+
typeArguments = undefined;
|
|
34830
34839
|
}
|
|
34831
34840
|
var argumentsArray;
|
|
34832
34841
|
if (token() === 20 /* OpenParenToken */) {
|
|
@@ -35923,6 +35932,9 @@ var ts;
|
|
|
35923
35932
|
function parseExpressionWithTypeArguments() {
|
|
35924
35933
|
var pos = getNodePos();
|
|
35925
35934
|
var expression = parseLeftHandSideExpressionOrHigher();
|
|
35935
|
+
if (expression.kind === 227 /* ExpressionWithTypeArguments */) {
|
|
35936
|
+
return expression;
|
|
35937
|
+
}
|
|
35926
35938
|
var typeArguments = tryParseTypeArguments();
|
|
35927
35939
|
return finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
35928
35940
|
}
|
|
@@ -36213,7 +36225,8 @@ var ts;
|
|
|
36213
36225
|
return finishNode(node, pos);
|
|
36214
36226
|
}
|
|
36215
36227
|
function parseExportSpecifier() {
|
|
36216
|
-
|
|
36228
|
+
var hasJSDoc = hasPrecedingJSDocComment();
|
|
36229
|
+
return withJSDoc(parseImportOrExportSpecifier(274 /* ExportSpecifier */), hasJSDoc);
|
|
36217
36230
|
}
|
|
36218
36231
|
function parseImportSpecifier() {
|
|
36219
36232
|
return parseImportOrExportSpecifier(269 /* ImportSpecifier */);
|
|
@@ -43418,14 +43431,12 @@ var ts;
|
|
|
43418
43431
|
}
|
|
43419
43432
|
var binder = createBinder();
|
|
43420
43433
|
function bindSourceFile(file, options) {
|
|
43421
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind" /* Bind */, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
|
|
43422
43434
|
ts.performance.mark("beforeBind");
|
|
43423
43435
|
ts.perfLogger.logStartBindFile("" + file.fileName);
|
|
43424
43436
|
binder(file, options);
|
|
43425
43437
|
ts.perfLogger.logStopBindFile();
|
|
43426
43438
|
ts.performance.mark("afterBind");
|
|
43427
43439
|
ts.performance.measure("Bind", "beforeBind", "afterBind");
|
|
43428
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
43429
43440
|
}
|
|
43430
43441
|
ts.bindSourceFile = bindSourceFile;
|
|
43431
43442
|
function createBinder() {
|
|
@@ -43485,7 +43496,9 @@ var ts;
|
|
|
43485
43496
|
ts.Debug.attachFlowNodeDebugInfo(unreachableFlow);
|
|
43486
43497
|
ts.Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow);
|
|
43487
43498
|
if (!file.locals) {
|
|
43499
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind" /* Bind */, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
|
|
43488
43500
|
bind(file);
|
|
43501
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
43489
43502
|
file.symbolCount = symbolCount;
|
|
43490
43503
|
file.classifiableNames = classifiableNames;
|
|
43491
43504
|
delayedBindJSDocTypedefTag();
|
|
@@ -47752,6 +47765,9 @@ var ts;
|
|
|
47752
47765
|
suggestionDiagnostics.add(diagnostic);
|
|
47753
47766
|
return diagnostic;
|
|
47754
47767
|
}
|
|
47768
|
+
function isDeprecatedSymbol(symbol) {
|
|
47769
|
+
return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 134217728 /* Deprecated */);
|
|
47770
|
+
}
|
|
47755
47771
|
function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {
|
|
47756
47772
|
var diagnostic = ts.createDiagnosticForNode(location, ts.Diagnostics._0_is_deprecated, deprecatedEntity);
|
|
47757
47773
|
return addDeprecatedSuggestionWorker(declarations, diagnostic);
|
|
@@ -50847,7 +50863,7 @@ var ts;
|
|
|
50847
50863
|
// get symbol of the first identifier of the entityName
|
|
50848
50864
|
var meaning;
|
|
50849
50865
|
if (entityName.parent.kind === 180 /* TypeQuery */ ||
|
|
50850
|
-
ts.
|
|
50866
|
+
entityName.parent.kind === 227 /* ExpressionWithTypeArguments */ && !ts.isPartOfTypeNode(entityName.parent) ||
|
|
50851
50867
|
entityName.parent.kind === 161 /* ComputedPropertyName */) {
|
|
50852
50868
|
// Typeof value
|
|
50853
50869
|
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
|
|
@@ -50958,7 +50974,7 @@ var ts;
|
|
|
50958
50974
|
return flags & 814775659 /* NodeBuilderFlagsMask */;
|
|
50959
50975
|
}
|
|
50960
50976
|
function isClassInstanceSide(type) {
|
|
50961
|
-
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288 /* Object */) && !!(ts.getObjectFlags(type) &
|
|
50977
|
+
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288 /* Object */) && !!(ts.getObjectFlags(type) & 33554432 /* IsClassInstanceClone */)));
|
|
50962
50978
|
}
|
|
50963
50979
|
function createNodeBuilder() {
|
|
50964
50980
|
return {
|
|
@@ -52522,7 +52538,8 @@ var ts;
|
|
|
52522
52538
|
includePrivateSymbol === null || includePrivateSymbol === void 0 ? void 0 : includePrivateSymbol(sym);
|
|
52523
52539
|
}
|
|
52524
52540
|
if (ts.isIdentifier(node)) {
|
|
52525
|
-
var
|
|
52541
|
+
var type = getDeclaredTypeOfSymbol(sym);
|
|
52542
|
+
var name = sym.flags & 262144 /* TypeParameter */ && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration) ? typeParameterToName(type, context) : ts.factory.cloneNode(node);
|
|
52526
52543
|
name.symbol = sym; // for quickinfo, which uses identifier symbol information
|
|
52527
52544
|
return { introducesError: introducesError, node: ts.setEmitFlags(ts.setOriginalNode(name, node), 16777216 /* NoAsciiEscaping */) };
|
|
52528
52545
|
}
|
|
@@ -54885,7 +54902,7 @@ var ts;
|
|
|
54885
54902
|
members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.indexInfos);
|
|
54886
54903
|
result.objectFlags |= (ts.getObjectFlags(type) & 8192 /* JSLiteral */); // Propagate JSLiteral flag
|
|
54887
54904
|
if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
54888
|
-
result.objectFlags |=
|
|
54905
|
+
result.objectFlags |= 33554432 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type
|
|
54889
54906
|
}
|
|
54890
54907
|
return result;
|
|
54891
54908
|
}
|
|
@@ -56895,87 +56912,87 @@ var ts;
|
|
|
56895
56912
|
* Converts an AnonymousType to a ResolvedType.
|
|
56896
56913
|
*/
|
|
56897
56914
|
function resolveAnonymousTypeMembers(type) {
|
|
56898
|
-
var symbol = getMergedSymbol(type.symbol);
|
|
56899
56915
|
if (type.target) {
|
|
56900
56916
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
56901
|
-
var
|
|
56917
|
+
var members_6 = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/ false);
|
|
56902
56918
|
var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0 /* Call */), type.mapper);
|
|
56903
56919
|
var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper);
|
|
56904
|
-
var
|
|
56905
|
-
setStructuredTypeMembers(type,
|
|
56920
|
+
var indexInfos_1 = instantiateIndexInfos(getIndexInfosOfType(type.target), type.mapper);
|
|
56921
|
+
setStructuredTypeMembers(type, members_6, callSignatures, constructSignatures, indexInfos_1);
|
|
56922
|
+
return;
|
|
56906
56923
|
}
|
|
56907
|
-
|
|
56924
|
+
var symbol = getMergedSymbol(type.symbol);
|
|
56925
|
+
if (symbol.flags & 2048 /* TypeLiteral */) {
|
|
56908
56926
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
56909
|
-
var
|
|
56910
|
-
var callSignatures = getSignaturesOfSymbol(
|
|
56911
|
-
var constructSignatures = getSignaturesOfSymbol(
|
|
56912
|
-
var
|
|
56913
|
-
setStructuredTypeMembers(type,
|
|
56927
|
+
var members_7 = getMembersOfSymbol(symbol);
|
|
56928
|
+
var callSignatures = getSignaturesOfSymbol(members_7.get("__call" /* Call */));
|
|
56929
|
+
var constructSignatures = getSignaturesOfSymbol(members_7.get("__new" /* New */));
|
|
56930
|
+
var indexInfos_2 = getIndexInfosOfSymbol(symbol);
|
|
56931
|
+
setStructuredTypeMembers(type, members_7, callSignatures, constructSignatures, indexInfos_2);
|
|
56932
|
+
return;
|
|
56914
56933
|
}
|
|
56915
|
-
|
|
56916
|
-
|
|
56917
|
-
|
|
56918
|
-
|
|
56919
|
-
|
|
56920
|
-
|
|
56921
|
-
|
|
56922
|
-
|
|
56923
|
-
|
|
56924
|
-
|
|
56925
|
-
|
|
56926
|
-
|
|
56927
|
-
|
|
56928
|
-
members = varsOnly_1;
|
|
56929
|
-
}
|
|
56934
|
+
// Combinations of function, class, enum and module
|
|
56935
|
+
var members = emptySymbols;
|
|
56936
|
+
var indexInfos;
|
|
56937
|
+
if (symbol.exports) {
|
|
56938
|
+
members = getExportsOfSymbol(symbol);
|
|
56939
|
+
if (symbol === globalThisSymbol) {
|
|
56940
|
+
var varsOnly_1 = new ts.Map();
|
|
56941
|
+
members.forEach(function (p) {
|
|
56942
|
+
if (!(p.flags & 418 /* BlockScoped */)) {
|
|
56943
|
+
varsOnly_1.set(p.escapedName, p);
|
|
56944
|
+
}
|
|
56945
|
+
});
|
|
56946
|
+
members = varsOnly_1;
|
|
56930
56947
|
}
|
|
56931
|
-
|
|
56932
|
-
|
|
56933
|
-
|
|
56934
|
-
|
|
56935
|
-
|
|
56936
|
-
|
|
56937
|
-
|
|
56938
|
-
|
|
56939
|
-
|
|
56940
|
-
else if (baseConstructorType === anyType) {
|
|
56941
|
-
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
|
|
56942
|
-
}
|
|
56948
|
+
}
|
|
56949
|
+
var baseConstructorIndexInfo;
|
|
56950
|
+
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
56951
|
+
if (symbol.flags & 32 /* Class */) {
|
|
56952
|
+
var classType = getDeclaredTypeOfClassOrInterface(symbol);
|
|
56953
|
+
var baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
56954
|
+
if (baseConstructorType.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 8650752 /* TypeVariable */)) {
|
|
56955
|
+
members = ts.createSymbolTable(getNamedOrIndexSignatureMembers(members));
|
|
56956
|
+
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
|
|
56943
56957
|
}
|
|
56944
|
-
|
|
56945
|
-
|
|
56946
|
-
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
56958
|
+
else if (baseConstructorType === anyType) {
|
|
56959
|
+
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
|
|
56947
56960
|
}
|
|
56948
|
-
|
|
56949
|
-
|
|
56950
|
-
|
|
56951
|
-
|
|
56952
|
-
|
|
56953
|
-
|
|
56954
|
-
|
|
56955
|
-
|
|
56961
|
+
}
|
|
56962
|
+
var indexSymbol = getIndexSymbolFromSymbolTable(members);
|
|
56963
|
+
if (indexSymbol) {
|
|
56964
|
+
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
56965
|
+
}
|
|
56966
|
+
else {
|
|
56967
|
+
if (baseConstructorIndexInfo) {
|
|
56968
|
+
indexInfos = ts.append(indexInfos, baseConstructorIndexInfo);
|
|
56956
56969
|
}
|
|
56957
|
-
|
|
56958
|
-
|
|
56959
|
-
|
|
56960
|
-
// in the process of resolving (see issue #6072). The temporarily empty signature list
|
|
56961
|
-
// will never be observed because a qualified name can't reference signatures.
|
|
56962
|
-
if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {
|
|
56963
|
-
type.callSignatures = getSignaturesOfSymbol(symbol);
|
|
56970
|
+
if (symbol.flags & 384 /* Enum */ && (getDeclaredTypeOfSymbol(symbol).flags & 32 /* Enum */ ||
|
|
56971
|
+
ts.some(type.properties, function (prop) { return !!(getTypeOfSymbol(prop).flags & 296 /* NumberLike */); }))) {
|
|
56972
|
+
indexInfos = ts.append(indexInfos, enumNumberIndexInfo);
|
|
56964
56973
|
}
|
|
56965
|
-
|
|
56966
|
-
|
|
56967
|
-
|
|
56968
|
-
|
|
56969
|
-
|
|
56970
|
-
|
|
56971
|
-
|
|
56972
|
-
|
|
56973
|
-
|
|
56974
|
-
|
|
56975
|
-
|
|
56976
|
-
|
|
56977
|
-
|
|
56974
|
+
}
|
|
56975
|
+
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, indexInfos || ts.emptyArray);
|
|
56976
|
+
// We resolve the members before computing the signatures because a signature may use
|
|
56977
|
+
// typeof with a qualified name expression that circularly references the type we are
|
|
56978
|
+
// in the process of resolving (see issue #6072). The temporarily empty signature list
|
|
56979
|
+
// will never be observed because a qualified name can't reference signatures.
|
|
56980
|
+
if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {
|
|
56981
|
+
type.callSignatures = getSignaturesOfSymbol(symbol);
|
|
56982
|
+
}
|
|
56983
|
+
// And likewise for construct signatures for classes
|
|
56984
|
+
if (symbol.flags & 32 /* Class */) {
|
|
56985
|
+
var classType_1 = getDeclaredTypeOfClassOrInterface(symbol);
|
|
56986
|
+
var constructSignatures = symbol.members ? getSignaturesOfSymbol(symbol.members.get("__constructor" /* Constructor */)) : ts.emptyArray;
|
|
56987
|
+
if (symbol.flags & 16 /* Function */) {
|
|
56988
|
+
constructSignatures = ts.addRange(constructSignatures.slice(), ts.mapDefined(type.callSignatures, function (sig) { return isJSConstructor(sig.declaration) ?
|
|
56989
|
+
createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, classType_1, /*resolvedTypePredicate*/ undefined, sig.minArgumentCount, sig.flags & 39 /* PropagatingFlags */) :
|
|
56990
|
+
undefined; }));
|
|
56991
|
+
}
|
|
56992
|
+
if (!constructSignatures.length) {
|
|
56993
|
+
constructSignatures = getDefaultConstructSignatures(classType_1);
|
|
56978
56994
|
}
|
|
56995
|
+
type.constructSignatures = constructSignatures;
|
|
56979
56996
|
}
|
|
56980
56997
|
}
|
|
56981
56998
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
@@ -57967,8 +57984,8 @@ var ts;
|
|
|
57967
57984
|
var stringIndexInfo;
|
|
57968
57985
|
var applicableInfo;
|
|
57969
57986
|
var applicableInfos;
|
|
57970
|
-
for (var _i = 0,
|
|
57971
|
-
var info =
|
|
57987
|
+
for (var _i = 0, indexInfos_3 = indexInfos; _i < indexInfos_3.length; _i++) {
|
|
57988
|
+
var info = indexInfos_3[_i];
|
|
57972
57989
|
if (info.keyType === stringType) {
|
|
57973
57990
|
stringIndexInfo = info;
|
|
57974
57991
|
}
|
|
@@ -58532,14 +58549,14 @@ var ts;
|
|
|
58532
58549
|
}
|
|
58533
58550
|
function getIndexInfosOfIndexSymbol(indexSymbol) {
|
|
58534
58551
|
if (indexSymbol.declarations) {
|
|
58535
|
-
var
|
|
58552
|
+
var indexInfos_4 = [];
|
|
58536
58553
|
var _loop_14 = function (declaration) {
|
|
58537
58554
|
if (declaration.parameters.length === 1) {
|
|
58538
58555
|
var parameter = declaration.parameters[0];
|
|
58539
58556
|
if (parameter.type) {
|
|
58540
58557
|
forEachType(getTypeFromTypeNode(parameter.type), function (keyType) {
|
|
58541
|
-
if (isValidIndexKeyType(keyType) && !findIndexInfo(
|
|
58542
|
-
|
|
58558
|
+
if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos_4, keyType)) {
|
|
58559
|
+
indexInfos_4.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasEffectiveModifier(declaration, 64 /* Readonly */), declaration));
|
|
58543
58560
|
}
|
|
58544
58561
|
});
|
|
58545
58562
|
}
|
|
@@ -58549,7 +58566,7 @@ var ts;
|
|
|
58549
58566
|
var declaration = _a[_i];
|
|
58550
58567
|
_loop_14(declaration);
|
|
58551
58568
|
}
|
|
58552
|
-
return
|
|
58569
|
+
return indexInfos_4;
|
|
58553
58570
|
}
|
|
58554
58571
|
return ts.emptyArray;
|
|
58555
58572
|
}
|
|
@@ -59097,7 +59114,7 @@ var ts;
|
|
|
59097
59114
|
// The expression is processed as an identifier expression (section 4.3)
|
|
59098
59115
|
// or property access expression(section 4.10),
|
|
59099
59116
|
// the widened type(section 3.9) of which becomes the result.
|
|
59100
|
-
var type =
|
|
59117
|
+
var type = checkExpressionWithTypeArguments(node);
|
|
59101
59118
|
links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(type));
|
|
59102
59119
|
}
|
|
59103
59120
|
return links.resolvedType;
|
|
@@ -60538,7 +60555,7 @@ var ts;
|
|
|
60538
60555
|
}
|
|
60539
60556
|
var prop = getPropertyOfType(objectType, propName);
|
|
60540
60557
|
if (prop) {
|
|
60541
|
-
if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations &&
|
|
60558
|
+
if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations && isDeprecatedSymbol(prop) && isUncalledFunctionReference(accessNode, prop)) {
|
|
60542
60559
|
var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);
|
|
60543
60560
|
addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName);
|
|
60544
60561
|
}
|
|
@@ -61801,7 +61818,9 @@ var ts;
|
|
|
61801
61818
|
return result;
|
|
61802
61819
|
}
|
|
61803
61820
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
61804
|
-
var declaration = type.objectFlags & 4 /* Reference */ ? type.node :
|
|
61821
|
+
var declaration = type.objectFlags & 4 /* Reference */ ? type.node :
|
|
61822
|
+
type.objectFlags & 16777216 /* InstantiationExpressionType */ ? type.node :
|
|
61823
|
+
type.symbol.declarations[0];
|
|
61805
61824
|
var links = getNodeLinks(declaration);
|
|
61806
61825
|
var target = type.objectFlags & 4 /* Reference */ ? links.resolvedType :
|
|
61807
61826
|
type.objectFlags & 64 /* Instantiated */ ? type.target : type;
|
|
@@ -61817,8 +61836,8 @@ var ts;
|
|
|
61817
61836
|
outerTypeParameters = ts.addRange(outerTypeParameters, templateTagParameters);
|
|
61818
61837
|
}
|
|
61819
61838
|
typeParameters = outerTypeParameters || ts.emptyArray;
|
|
61820
|
-
var allDeclarations_1 = type.objectFlags & 4 /* Reference */ ? [declaration] : type.symbol.declarations;
|
|
61821
|
-
typeParameters = (target.objectFlags & 4 /* Reference */ || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ?
|
|
61839
|
+
var allDeclarations_1 = type.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */) ? [declaration] : type.symbol.declarations;
|
|
61840
|
+
typeParameters = (target.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */) || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ?
|
|
61822
61841
|
ts.filter(typeParameters, function (tp) { return ts.some(allDeclarations_1, function (d) { return isTypeParameterPossiblyReferenced(tp, d); }); }) :
|
|
61823
61842
|
typeParameters;
|
|
61824
61843
|
links.outerTypeParameters = typeParameters;
|
|
@@ -61990,6 +62009,9 @@ var ts;
|
|
|
61990
62009
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
61991
62010
|
freshTypeParameter.mapper = mapper;
|
|
61992
62011
|
}
|
|
62012
|
+
if (type.objectFlags & 16777216 /* InstantiationExpressionType */) {
|
|
62013
|
+
result.node = type.node;
|
|
62014
|
+
}
|
|
61993
62015
|
result.target = type;
|
|
61994
62016
|
result.mapper = mapper;
|
|
61995
62017
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -65164,8 +65186,8 @@ var ts;
|
|
|
65164
65186
|
var indexInfos = getIndexInfosOfType(target);
|
|
65165
65187
|
var targetHasStringIndex = ts.some(indexInfos, function (info) { return info.keyType === stringType; });
|
|
65166
65188
|
var result = -1 /* True */;
|
|
65167
|
-
for (var _i = 0,
|
|
65168
|
-
var targetInfo =
|
|
65189
|
+
for (var _i = 0, indexInfos_5 = indexInfos; _i < indexInfos_5.length; _i++) {
|
|
65190
|
+
var targetInfo = indexInfos_5[_i];
|
|
65169
65191
|
var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ :
|
|
65170
65192
|
isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, 3 /* Both */, reportErrors) :
|
|
65171
65193
|
typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
|
|
@@ -65772,10 +65794,10 @@ var ts;
|
|
|
65772
65794
|
if (!(ts.getObjectFlags(type) & 4 /* Reference */) || !(ts.getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
65773
65795
|
return undefined;
|
|
65774
65796
|
}
|
|
65775
|
-
if (ts.getObjectFlags(type) &
|
|
65776
|
-
return ts.getObjectFlags(type) &
|
|
65797
|
+
if (ts.getObjectFlags(type) & 67108864 /* IdenticalBaseTypeCalculated */) {
|
|
65798
|
+
return ts.getObjectFlags(type) & 134217728 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : undefined;
|
|
65777
65799
|
}
|
|
65778
|
-
type.objectFlags |=
|
|
65800
|
+
type.objectFlags |= 67108864 /* IdenticalBaseTypeCalculated */;
|
|
65779
65801
|
var target = type.target;
|
|
65780
65802
|
if (ts.getObjectFlags(target) & 1 /* Class */) {
|
|
65781
65803
|
var baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -65796,7 +65818,7 @@ var ts;
|
|
|
65796
65818
|
if (ts.length(getTypeArguments(type)) > ts.length(target.typeParameters)) {
|
|
65797
65819
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, ts.last(getTypeArguments(type)));
|
|
65798
65820
|
}
|
|
65799
|
-
type.objectFlags |=
|
|
65821
|
+
type.objectFlags |= 134217728 /* IdenticalBaseTypeExists */;
|
|
65800
65822
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
65801
65823
|
}
|
|
65802
65824
|
function isEmptyLiteralType(type) {
|
|
@@ -66460,7 +66482,7 @@ var ts;
|
|
|
66460
66482
|
var result = !!(type.flags & 465829888 /* Instantiable */ ||
|
|
66461
66483
|
type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) ||
|
|
66462
66484
|
objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations ||
|
|
66463
|
-
objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 8388608 /* ObjectRestType */)) ||
|
|
66485
|
+
objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 8388608 /* ObjectRestType */ | 16777216 /* InstantiationExpressionType */)) ||
|
|
66464
66486
|
type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && ts.some(type.types, couldContainTypeVariables));
|
|
66465
66487
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
66466
66488
|
type.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (result ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
@@ -67377,8 +67399,8 @@ var ts;
|
|
|
67377
67399
|
var priority = (ts.getObjectFlags(source) & ts.getObjectFlags(target) & 32 /* Mapped */) ? 8 /* HomomorphicMappedType */ : 0;
|
|
67378
67400
|
var indexInfos = getIndexInfosOfType(target);
|
|
67379
67401
|
if (isObjectTypeWithInferableIndex(source)) {
|
|
67380
|
-
for (var _i = 0,
|
|
67381
|
-
var targetInfo =
|
|
67402
|
+
for (var _i = 0, indexInfos_6 = indexInfos; _i < indexInfos_6.length; _i++) {
|
|
67403
|
+
var targetInfo = indexInfos_6[_i];
|
|
67382
67404
|
var propTypes = [];
|
|
67383
67405
|
for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) {
|
|
67384
67406
|
var prop = _b[_a];
|
|
@@ -67398,8 +67420,8 @@ var ts;
|
|
|
67398
67420
|
}
|
|
67399
67421
|
}
|
|
67400
67422
|
}
|
|
67401
|
-
for (var _e = 0,
|
|
67402
|
-
var targetInfo =
|
|
67423
|
+
for (var _e = 0, indexInfos_7 = indexInfos; _e < indexInfos_7.length; _e++) {
|
|
67424
|
+
var targetInfo = indexInfos_7[_e];
|
|
67403
67425
|
var sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType);
|
|
67404
67426
|
if (sourceInfo) {
|
|
67405
67427
|
inferWithPriority(sourceInfo.type, targetInfo.type, priority);
|
|
@@ -69941,9 +69963,9 @@ var ts;
|
|
|
69941
69963
|
markAliasReferenced(symbol, node);
|
|
69942
69964
|
}
|
|
69943
69965
|
var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
69944
|
-
var
|
|
69945
|
-
if (
|
|
69946
|
-
addDeprecatedSuggestion(node,
|
|
69966
|
+
var targetSymbol = checkDeprecatedAliasedSymbol(localOrExportSymbol, node);
|
|
69967
|
+
if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
|
|
69968
|
+
addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
|
|
69947
69969
|
}
|
|
69948
69970
|
var declaration = localOrExportSymbol.valueDeclaration;
|
|
69949
69971
|
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
|
|
@@ -72955,7 +72977,7 @@ var ts;
|
|
|
72955
72977
|
}
|
|
72956
72978
|
}
|
|
72957
72979
|
else {
|
|
72958
|
-
if (
|
|
72980
|
+
if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
|
|
72959
72981
|
addDeprecatedSuggestion(right, prop.declarations, right.escapedText);
|
|
72960
72982
|
}
|
|
72961
72983
|
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
|
|
@@ -74414,7 +74436,7 @@ var ts;
|
|
|
74414
74436
|
}
|
|
74415
74437
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
74416
74438
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
74417
|
-
var chain = ts.chainDiagnosticMessages(ts.map(diags_3,
|
|
74439
|
+
var chain = ts.chainDiagnosticMessages(ts.map(diags_3, ts.createDiagnosticMessageChainFromDiagnostic), ts.Diagnostics.No_overload_matches_this_call);
|
|
74418
74440
|
// The below is a spread to guarantee we get a new (mutable) array - our `flatMap` helper tries to do "smart" optimizations where it reuses input
|
|
74419
74441
|
// arrays and the emptyArray singleton where possible, which is decidedly not what we want while we're still constructing this diagnostic
|
|
74420
74442
|
var related = __spreadArray([], ts.flatMap(diags_3, function (d) { return d.relatedInformation; }), true);
|
|
@@ -75569,6 +75591,66 @@ var ts;
|
|
|
75569
75591
|
return node.flags & 32 /* OptionalChain */ ? checkNonNullChain(node) :
|
|
75570
75592
|
getNonNullableType(checkExpression(node.expression));
|
|
75571
75593
|
}
|
|
75594
|
+
function checkExpressionWithTypeArguments(node) {
|
|
75595
|
+
checkGrammarExpressionWithTypeArguments(node);
|
|
75596
|
+
var exprType = node.kind === 227 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) :
|
|
75597
|
+
ts.isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) :
|
|
75598
|
+
checkExpression(node.exprName);
|
|
75599
|
+
var typeArguments = node.typeArguments;
|
|
75600
|
+
if (!ts.some(typeArguments)) {
|
|
75601
|
+
return exprType;
|
|
75602
|
+
}
|
|
75603
|
+
var funcType = getApparentType(exprType);
|
|
75604
|
+
if (funcType === silentNeverType || isErrorType(funcType)) {
|
|
75605
|
+
return funcType;
|
|
75606
|
+
}
|
|
75607
|
+
var hasSomeApplicableSignature = false;
|
|
75608
|
+
var nonApplicableType;
|
|
75609
|
+
var hasSignatures;
|
|
75610
|
+
var hasApplicableSignature;
|
|
75611
|
+
var result = mapType(funcType, getInstantiatedType);
|
|
75612
|
+
var errorType = hasSomeApplicableSignature ? nonApplicableType : funcType;
|
|
75613
|
+
if (errorType) {
|
|
75614
|
+
diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, typeToString(errorType)));
|
|
75615
|
+
}
|
|
75616
|
+
return result;
|
|
75617
|
+
function getInstantiatedType(type) {
|
|
75618
|
+
hasSignatures = false;
|
|
75619
|
+
hasApplicableSignature = false;
|
|
75620
|
+
var result = getInstantiatedTypeWorker(type);
|
|
75621
|
+
hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature);
|
|
75622
|
+
if (hasSignatures && !hasApplicableSignature) {
|
|
75623
|
+
nonApplicableType !== null && nonApplicableType !== void 0 ? nonApplicableType : (nonApplicableType = type);
|
|
75624
|
+
}
|
|
75625
|
+
return result;
|
|
75626
|
+
}
|
|
75627
|
+
function getInstantiatedTypeWorker(type) {
|
|
75628
|
+
if (type.flags & 524288 /* Object */) {
|
|
75629
|
+
var resolved = resolveStructuredTypeMembers(type);
|
|
75630
|
+
var callSignatures = getInstantiatedSignatures(resolved.callSignatures);
|
|
75631
|
+
var constructSignatures = getInstantiatedSignatures(resolved.constructSignatures);
|
|
75632
|
+
hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
|
|
75633
|
+
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
75634
|
+
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
75635
|
+
var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
75636
|
+
result_11.objectFlags |= 16777216 /* InstantiationExpressionType */;
|
|
75637
|
+
result_11.node = node;
|
|
75638
|
+
return result_11;
|
|
75639
|
+
}
|
|
75640
|
+
}
|
|
75641
|
+
else if (type.flags & 2097152 /* Intersection */) {
|
|
75642
|
+
return getIntersectionType(ts.sameMap(type.types, getInstantiatedTypeWorker));
|
|
75643
|
+
}
|
|
75644
|
+
return type;
|
|
75645
|
+
}
|
|
75646
|
+
function getInstantiatedSignatures(signatures) {
|
|
75647
|
+
var applicableSignatures = ts.filter(signatures, function (sig) { return !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments); });
|
|
75648
|
+
return ts.sameMap(applicableSignatures, function (sig) {
|
|
75649
|
+
var typeArgumentTypes = checkTypeArguments(sig, typeArguments, /*reportErrors*/ true);
|
|
75650
|
+
return typeArgumentTypes ? getSignatureInstantiation(sig, typeArgumentTypes, ts.isInJSFile(sig.declaration)) : sig;
|
|
75651
|
+
});
|
|
75652
|
+
}
|
|
75653
|
+
}
|
|
75572
75654
|
function checkMetaProperty(node) {
|
|
75573
75655
|
checkGrammarMetaProperty(node);
|
|
75574
75656
|
if (node.keywordToken === 103 /* NewKeyword */) {
|
|
@@ -78078,6 +78160,8 @@ var ts;
|
|
|
78078
78160
|
return checkAssertion(node);
|
|
78079
78161
|
case 229 /* NonNullExpression */:
|
|
78080
78162
|
return checkNonNullAssertion(node);
|
|
78163
|
+
case 227 /* ExpressionWithTypeArguments */:
|
|
78164
|
+
return checkExpressionWithTypeArguments(node);
|
|
78081
78165
|
case 230 /* MetaProperty */:
|
|
78082
78166
|
return checkMetaProperty(node);
|
|
78083
78167
|
case 214 /* DeleteExpression */:
|
|
@@ -79283,12 +79367,12 @@ var ts;
|
|
|
79283
79367
|
case 264 /* ImportEqualsDeclaration */:
|
|
79284
79368
|
case 267 /* NamespaceImport */:
|
|
79285
79369
|
case 266 /* ImportClause */:
|
|
79286
|
-
var
|
|
79370
|
+
var result_12 = 0 /* None */;
|
|
79287
79371
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
79288
79372
|
ts.forEach(target.declarations, function (d) {
|
|
79289
|
-
|
|
79373
|
+
result_12 |= getDeclarationSpaces(d);
|
|
79290
79374
|
});
|
|
79291
|
-
return
|
|
79375
|
+
return result_12;
|
|
79292
79376
|
case 253 /* VariableDeclaration */:
|
|
79293
79377
|
case 202 /* BindingElement */:
|
|
79294
79378
|
case 255 /* FunctionDeclaration */:
|
|
@@ -81875,8 +81959,8 @@ var ts;
|
|
|
81875
81959
|
}
|
|
81876
81960
|
}
|
|
81877
81961
|
if (indexInfos.length > 1) {
|
|
81878
|
-
for (var _d = 0,
|
|
81879
|
-
var info =
|
|
81962
|
+
for (var _d = 0, indexInfos_8 = indexInfos; _d < indexInfos_8.length; _d++) {
|
|
81963
|
+
var info = indexInfos_8[_d];
|
|
81880
81964
|
checkIndexConstraintForIndexSignature(type, info);
|
|
81881
81965
|
}
|
|
81882
81966
|
}
|
|
@@ -81902,8 +81986,8 @@ var ts;
|
|
|
81902
81986
|
error(errorNode, ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3, symbolToString(prop), typeToString(propType), typeToString(info.keyType), typeToString(info.type));
|
|
81903
81987
|
}
|
|
81904
81988
|
};
|
|
81905
|
-
for (var _i = 0,
|
|
81906
|
-
var info =
|
|
81989
|
+
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
81990
|
+
var info = indexInfos_9[_i];
|
|
81907
81991
|
_loop_27(info);
|
|
81908
81992
|
}
|
|
81909
81993
|
}
|
|
@@ -81925,8 +82009,8 @@ var ts;
|
|
|
81925
82009
|
error(errorNode, ts.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3, typeToString(checkInfo.keyType), typeToString(checkInfo.type), typeToString(info.keyType), typeToString(info.type));
|
|
81926
82010
|
}
|
|
81927
82011
|
};
|
|
81928
|
-
for (var _i = 0,
|
|
81929
|
-
var info =
|
|
82012
|
+
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
82013
|
+
var info = indexInfos_10[_i];
|
|
81930
82014
|
_loop_28(info);
|
|
81931
82015
|
}
|
|
81932
82016
|
}
|
|
@@ -82793,16 +82877,15 @@ var ts;
|
|
|
82793
82877
|
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
|
|
82794
82878
|
case 206 /* ElementAccessExpression */:
|
|
82795
82879
|
case 205 /* PropertyAccessExpression */:
|
|
82796
|
-
|
|
82797
|
-
|
|
82798
|
-
var type = getTypeOfExpression(ex.expression);
|
|
82880
|
+
if (isConstantMemberAccess(expr)) {
|
|
82881
|
+
var type = getTypeOfExpression(expr.expression);
|
|
82799
82882
|
if (type.symbol && type.symbol.flags & 384 /* Enum */) {
|
|
82800
82883
|
var name = void 0;
|
|
82801
|
-
if (
|
|
82802
|
-
name =
|
|
82884
|
+
if (expr.kind === 205 /* PropertyAccessExpression */) {
|
|
82885
|
+
name = expr.name.escapedText;
|
|
82803
82886
|
}
|
|
82804
82887
|
else {
|
|
82805
|
-
name = ts.escapeLeadingUnderscores(ts.cast(
|
|
82888
|
+
name = ts.escapeLeadingUnderscores(ts.cast(expr.argumentExpression, ts.isLiteralExpression).text);
|
|
82806
82889
|
}
|
|
82807
82890
|
return evaluateEnumMember(expr, type.symbol, name);
|
|
82808
82891
|
}
|
|
@@ -82830,6 +82913,10 @@ var ts;
|
|
|
82830
82913
|
}
|
|
82831
82914
|
}
|
|
82832
82915
|
function isConstantMemberAccess(node) {
|
|
82916
|
+
var type = getTypeOfExpression(node);
|
|
82917
|
+
if (type === errorType) {
|
|
82918
|
+
return false;
|
|
82919
|
+
}
|
|
82833
82920
|
return node.kind === 79 /* Identifier */ ||
|
|
82834
82921
|
node.kind === 205 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) ||
|
|
82835
82922
|
node.kind === 206 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) &&
|
|
@@ -83124,7 +83211,6 @@ var ts;
|
|
|
83124
83211
|
return true;
|
|
83125
83212
|
}
|
|
83126
83213
|
function checkAliasSymbol(node) {
|
|
83127
|
-
var _a;
|
|
83128
83214
|
var symbol = getSymbolOfNode(node);
|
|
83129
83215
|
var target = resolveAlias(symbol);
|
|
83130
83216
|
if (target !== unknownSymbol) {
|
|
@@ -83180,11 +83266,46 @@ var ts;
|
|
|
83180
83266
|
}
|
|
83181
83267
|
}
|
|
83182
83268
|
}
|
|
83183
|
-
if (ts.isImportSpecifier(node)
|
|
83184
|
-
|
|
83269
|
+
if (ts.isImportSpecifier(node)) {
|
|
83270
|
+
var targetSymbol = checkDeprecatedAliasedSymbol(symbol, node);
|
|
83271
|
+
if (isDeprecatedAliasedSymbol(targetSymbol) && targetSymbol.declarations) {
|
|
83272
|
+
addDeprecatedSuggestion(node, targetSymbol.declarations, targetSymbol.escapedName);
|
|
83273
|
+
}
|
|
83185
83274
|
}
|
|
83186
83275
|
}
|
|
83187
83276
|
}
|
|
83277
|
+
function isDeprecatedAliasedSymbol(symbol) {
|
|
83278
|
+
return !!symbol.declarations && ts.every(symbol.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); });
|
|
83279
|
+
}
|
|
83280
|
+
function checkDeprecatedAliasedSymbol(symbol, location) {
|
|
83281
|
+
if (!(symbol.flags & 2097152 /* Alias */))
|
|
83282
|
+
return symbol;
|
|
83283
|
+
var targetSymbol = resolveAlias(symbol);
|
|
83284
|
+
if (targetSymbol === unknownSymbol)
|
|
83285
|
+
return targetSymbol;
|
|
83286
|
+
while (symbol.flags & 2097152 /* Alias */) {
|
|
83287
|
+
var target = getImmediateAliasedSymbol(symbol);
|
|
83288
|
+
if (target) {
|
|
83289
|
+
if (target === targetSymbol)
|
|
83290
|
+
break;
|
|
83291
|
+
if (target.declarations && ts.length(target.declarations)) {
|
|
83292
|
+
if (isDeprecatedAliasedSymbol(target)) {
|
|
83293
|
+
addDeprecatedSuggestion(location, target.declarations, target.escapedName);
|
|
83294
|
+
break;
|
|
83295
|
+
}
|
|
83296
|
+
else {
|
|
83297
|
+
if (symbol === targetSymbol)
|
|
83298
|
+
break;
|
|
83299
|
+
symbol = target;
|
|
83300
|
+
}
|
|
83301
|
+
}
|
|
83302
|
+
}
|
|
83303
|
+
else {
|
|
83304
|
+
break;
|
|
83305
|
+
}
|
|
83306
|
+
}
|
|
83307
|
+
return targetSymbol;
|
|
83308
|
+
}
|
|
83188
83309
|
function checkImportBinding(node) {
|
|
83189
83310
|
checkCollisionsForDeclarationName(node, node.name);
|
|
83190
83311
|
checkAliasSymbol(node);
|
|
@@ -87485,7 +87606,7 @@ var ts;
|
|
|
87485
87606
|
return factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
87486
87607
|
case 180 /* TypeQuery */:
|
|
87487
87608
|
ts.Debug.type(node);
|
|
87488
|
-
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName));
|
|
87609
|
+
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
|
|
87489
87610
|
case 181 /* TypeLiteral */:
|
|
87490
87611
|
ts.Debug.type(node);
|
|
87491
87612
|
return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
|
|
@@ -90377,8 +90498,8 @@ var ts;
|
|
|
90377
90498
|
function generateClassElementDecorationExpressions(node, isStatic) {
|
|
90378
90499
|
var members = getDecoratedClassElements(node, isStatic);
|
|
90379
90500
|
var expressions;
|
|
90380
|
-
for (var _i = 0,
|
|
90381
|
-
var member =
|
|
90501
|
+
for (var _i = 0, members_8 = members; _i < members_8.length; _i++) {
|
|
90502
|
+
var member = members_8[_i];
|
|
90382
90503
|
var expression = generateClassElementDecorationExpression(node, member);
|
|
90383
90504
|
if (expression) {
|
|
90384
90505
|
if (!expressions) {
|
|
@@ -95579,8 +95700,8 @@ var ts;
|
|
|
95579
95700
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
95580
95701
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
95581
95702
|
if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
|
|
95582
|
-
var
|
|
95583
|
-
return
|
|
95703
|
+
var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
95704
|
+
return result_13 && factory.createPropertyAssignment("children", result_13);
|
|
95584
95705
|
}
|
|
95585
95706
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
95586
95707
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -109209,6 +109330,8 @@ var ts;
|
|
|
109209
109330
|
return emitAsExpression(node);
|
|
109210
109331
|
case 229 /* NonNullExpression */:
|
|
109211
109332
|
return emitNonNullExpression(node);
|
|
109333
|
+
case 227 /* ExpressionWithTypeArguments */:
|
|
109334
|
+
return emitExpressionWithTypeArguments(node);
|
|
109212
109335
|
case 230 /* MetaProperty */:
|
|
109213
109336
|
return emitMetaProperty(node);
|
|
109214
109337
|
case 231 /* SyntheticExpression */:
|
|
@@ -109653,6 +109776,7 @@ var ts;
|
|
|
109653
109776
|
writeKeyword("typeof");
|
|
109654
109777
|
writeSpace();
|
|
109655
109778
|
emit(node.exprName);
|
|
109779
|
+
emitTypeArguments(node, node.typeArguments);
|
|
109656
109780
|
}
|
|
109657
109781
|
function emitTypeLiteral(node) {
|
|
109658
109782
|
writePunctuation("{");
|
|
@@ -114612,15 +114736,15 @@ var ts;
|
|
|
114612
114736
|
// which per above occurred during the current program creation.
|
|
114613
114737
|
// Since we assume the filesystem does not change during program creation,
|
|
114614
114738
|
// it is safe to reuse resolutions from the earlier call.
|
|
114615
|
-
var
|
|
114739
|
+
var result_14 = [];
|
|
114616
114740
|
var i = 0;
|
|
114617
114741
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
114618
114742
|
var moduleName = moduleNames_1[_i];
|
|
114619
114743
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
114620
114744
|
i++;
|
|
114621
|
-
|
|
114745
|
+
result_14.push(resolvedModule);
|
|
114622
114746
|
}
|
|
114623
|
-
return
|
|
114747
|
+
return result_14;
|
|
114624
114748
|
}
|
|
114625
114749
|
// At this point, we know at least one of the following hold:
|
|
114626
114750
|
// - file has local declarations for ambient modules
|
|
@@ -115842,14 +115966,14 @@ var ts;
|
|
|
115842
115966
|
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
|
115843
115967
|
addFileToFilesByName(dupFile, path, redirectedPath);
|
|
115844
115968
|
addFileIncludeReason(dupFile, reason);
|
|
115845
|
-
sourceFileToPackageName.set(path, packageId
|
|
115969
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
115846
115970
|
processingOtherFiles.push(dupFile);
|
|
115847
115971
|
return dupFile;
|
|
115848
115972
|
}
|
|
115849
115973
|
else if (file) {
|
|
115850
115974
|
// This is the first source file to have this packageId.
|
|
115851
115975
|
packageIdToSourceFile.set(packageIdKey, file);
|
|
115852
|
-
sourceFileToPackageName.set(path, packageId
|
|
115976
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
115853
115977
|
}
|
|
115854
115978
|
}
|
|
115855
115979
|
addFileToFilesByName(file, path, redirectedPath);
|
|
@@ -119728,9 +119852,9 @@ var ts;
|
|
|
119728
119852
|
if (!preferSymlinks) {
|
|
119729
119853
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
119730
119854
|
// so we only need to remove them from the realpath filenames.
|
|
119731
|
-
var
|
|
119732
|
-
if (
|
|
119733
|
-
return
|
|
119855
|
+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
119856
|
+
if (result_15)
|
|
119857
|
+
return result_15;
|
|
119734
119858
|
}
|
|
119735
119859
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
119736
119860
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -119750,10 +119874,10 @@ var ts;
|
|
|
119750
119874
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
119751
119875
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
119752
119876
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
119753
|
-
var
|
|
119877
|
+
var result_16 = cb(option, target === referenceRedirect);
|
|
119754
119878
|
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
119755
|
-
if (
|
|
119756
|
-
return
|
|
119879
|
+
if (result_16)
|
|
119880
|
+
return result_16;
|
|
119757
119881
|
}
|
|
119758
119882
|
});
|
|
119759
119883
|
});
|