@typescript-deploys/pr-build 4.6.0-pr-47550-8 → 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 +318 -190
- package/lib/tsserver.js +632 -302
- package/lib/tsserverlibrary.d.ts +16 -12
- package/lib/tsserverlibrary.js +632 -302
- package/lib/typescript.d.ts +16 -12
- package/lib/typescript.js +632 -302
- package/lib/typescriptServices.d.ts +16 -12
- package/lib/typescriptServices.js +632 -302
- package/lib/typingsInstaller.js +337 -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) {
|
|
@@ -4907,13 +4907,14 @@ var ts;
|
|
|
4907
4907
|
// Flags that require TypeFlags.Object
|
|
4908
4908
|
ObjectFlags[ObjectFlags["ContainsSpread"] = 4194304] = "ContainsSpread";
|
|
4909
4909
|
ObjectFlags[ObjectFlags["ObjectRestType"] = 8388608] = "ObjectRestType";
|
|
4910
|
+
ObjectFlags[ObjectFlags["InstantiationExpressionType"] = 16777216] = "InstantiationExpressionType";
|
|
4910
4911
|
/* @internal */
|
|
4911
|
-
ObjectFlags[ObjectFlags["IsClassInstanceClone"] =
|
|
4912
|
+
ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 33554432] = "IsClassInstanceClone";
|
|
4912
4913
|
// Flags that require TypeFlags.Object and ObjectFlags.Reference
|
|
4913
4914
|
/* @internal */
|
|
4914
|
-
ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] =
|
|
4915
|
+
ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] = 67108864] = "IdenticalBaseTypeCalculated";
|
|
4915
4916
|
/* @internal */
|
|
4916
|
-
ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] =
|
|
4917
|
+
ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] = 134217728] = "IdenticalBaseTypeExists";
|
|
4917
4918
|
// Flags that require TypeFlags.UnionOrIntersection or TypeFlags.Substitution
|
|
4918
4919
|
/* @internal */
|
|
4919
4920
|
ObjectFlags[ObjectFlags["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
|
|
@@ -8519,6 +8520,7 @@ var ts;
|
|
|
8519
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."),
|
|
8520
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"),
|
|
8521
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."),
|
|
8522
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."),
|
|
8523
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."),
|
|
8524
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."),
|
|
@@ -9462,6 +9464,8 @@ var ts;
|
|
|
9462
9464
|
Remove_unused_declarations_for_Colon_0: diag(90041, ts.DiagnosticCategory.Message, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"),
|
|
9463
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}'."),
|
|
9464
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}\""),
|
|
9465
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"),
|
|
9466
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}'"),
|
|
9467
9471
|
Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -13402,6 +13406,7 @@ var ts;
|
|
|
13402
13406
|
case 110 /* TrueKeyword */:
|
|
13403
13407
|
case 106 /* SuperKeyword */:
|
|
13404
13408
|
case 229 /* NonNullExpression */:
|
|
13409
|
+
case 227 /* ExpressionWithTypeArguments */:
|
|
13405
13410
|
case 230 /* MetaProperty */:
|
|
13406
13411
|
case 100 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression
|
|
13407
13412
|
return true;
|
|
@@ -14052,10 +14057,13 @@ var ts;
|
|
|
14052
14057
|
function packageIdIsEqual(a, b) {
|
|
14053
14058
|
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
14054
14059
|
}
|
|
14055
|
-
function
|
|
14056
|
-
var name = _a.name, subModuleName = _a.subModuleName
|
|
14057
|
-
|
|
14058
|
-
|
|
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;
|
|
14059
14067
|
}
|
|
14060
14068
|
ts.packageIdToString = packageIdToString;
|
|
14061
14069
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -14888,6 +14896,15 @@ var ts;
|
|
|
14888
14896
|
};
|
|
14889
14897
|
}
|
|
14890
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;
|
|
14891
14908
|
function createDiagnosticForRange(sourceFile, range, message) {
|
|
14892
14909
|
return {
|
|
14893
14910
|
file: sourceFile,
|
|
@@ -15056,7 +15073,8 @@ var ts;
|
|
|
15056
15073
|
node.kind === 212 /* FunctionExpression */ ||
|
|
15057
15074
|
node.kind === 213 /* ArrowFunction */ ||
|
|
15058
15075
|
node.kind === 211 /* ParenthesizedExpression */ ||
|
|
15059
|
-
node.kind === 253 /* VariableDeclaration */
|
|
15076
|
+
node.kind === 253 /* VariableDeclaration */ ||
|
|
15077
|
+
node.kind === 274 /* ExportSpecifier */) ?
|
|
15060
15078
|
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
|
|
15061
15079
|
ts.getLeadingCommentRanges(text, node.pos);
|
|
15062
15080
|
// True if the comment starts with '/**' but not if it is '/**/'
|
|
@@ -15090,7 +15108,7 @@ var ts;
|
|
|
15090
15108
|
case 114 /* VoidKeyword */:
|
|
15091
15109
|
return node.parent.kind !== 216 /* VoidExpression */;
|
|
15092
15110
|
case 227 /* ExpressionWithTypeArguments */:
|
|
15093
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
15111
|
+
return ts.isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
15094
15112
|
case 162 /* TypeParameter */:
|
|
15095
15113
|
return node.parent.kind === 194 /* MappedType */ || node.parent.kind === 189 /* InferType */;
|
|
15096
15114
|
// Identifiers and qualified names may be type nodes, depending on their context. Climb
|
|
@@ -15127,7 +15145,7 @@ var ts;
|
|
|
15127
15145
|
}
|
|
15128
15146
|
switch (parent.kind) {
|
|
15129
15147
|
case 227 /* ExpressionWithTypeArguments */:
|
|
15130
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
15148
|
+
return ts.isHeritageClause(parent.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
15131
15149
|
case 162 /* TypeParameter */:
|
|
15132
15150
|
return node === parent.constraint;
|
|
15133
15151
|
case 342 /* JSDocTemplateTag */:
|
|
@@ -15830,7 +15848,7 @@ var ts;
|
|
|
15830
15848
|
case 296 /* SpreadAssignment */:
|
|
15831
15849
|
return true;
|
|
15832
15850
|
case 227 /* ExpressionWithTypeArguments */:
|
|
15833
|
-
return parent.expression === node &&
|
|
15851
|
+
return parent.expression === node && !isPartOfTypeNode(parent);
|
|
15834
15852
|
case 295 /* ShorthandPropertyAssignment */:
|
|
15835
15853
|
return parent.objectAssignmentInitializer === node;
|
|
15836
15854
|
default:
|
|
@@ -22764,16 +22782,18 @@ var ts;
|
|
|
22764
22782
|
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
|
|
22765
22783
|
}
|
|
22766
22784
|
// @api
|
|
22767
|
-
function createTypeQueryNode(exprName) {
|
|
22785
|
+
function createTypeQueryNode(exprName, typeArguments) {
|
|
22768
22786
|
var node = createBaseNode(180 /* TypeQuery */);
|
|
22769
22787
|
node.exprName = exprName;
|
|
22788
|
+
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
22770
22789
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22771
22790
|
return node;
|
|
22772
22791
|
}
|
|
22773
22792
|
// @api
|
|
22774
|
-
function updateTypeQueryNode(node, exprName) {
|
|
22793
|
+
function updateTypeQueryNode(node, exprName, typeArguments) {
|
|
22775
22794
|
return node.exprName !== exprName
|
|
22776
|
-
|
|
22795
|
+
|| node.typeArguments !== typeArguments
|
|
22796
|
+
? update(createTypeQueryNode(exprName, typeArguments), node)
|
|
22777
22797
|
: node;
|
|
22778
22798
|
}
|
|
22779
22799
|
// @api
|
|
@@ -29889,7 +29909,8 @@ var ts;
|
|
|
29889
29909
|
visitNode(cbNode, node.parameterName) ||
|
|
29890
29910
|
visitNode(cbNode, node.type);
|
|
29891
29911
|
case 180 /* TypeQuery */:
|
|
29892
|
-
return visitNode(cbNode, node.exprName)
|
|
29912
|
+
return visitNode(cbNode, node.exprName) ||
|
|
29913
|
+
visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
29893
29914
|
case 181 /* TypeLiteral */:
|
|
29894
29915
|
return visitNodes(cbNode, cbNodes, node.members);
|
|
29895
29916
|
case 182 /* ArrayType */:
|
|
@@ -32422,7 +32443,9 @@ var ts;
|
|
|
32422
32443
|
function parseTypeQuery() {
|
|
32423
32444
|
var pos = getNodePos();
|
|
32424
32445
|
parseExpected(112 /* TypeOfKeyword */);
|
|
32425
|
-
|
|
32446
|
+
var entityName = parseEntityName(/*allowReservedWords*/ true);
|
|
32447
|
+
var typeArguments = tryParseTypeArguments();
|
|
32448
|
+
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
32426
32449
|
}
|
|
32427
32450
|
function parseTypeParameter() {
|
|
32428
32451
|
var pos = getNodePos();
|
|
@@ -33361,7 +33384,7 @@ var ts;
|
|
|
33361
33384
|
function parseInitializer() {
|
|
33362
33385
|
return parseOptional(63 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined;
|
|
33363
33386
|
}
|
|
33364
|
-
function parseAssignmentExpressionOrHigher(
|
|
33387
|
+
function parseAssignmentExpressionOrHigher() {
|
|
33365
33388
|
// AssignmentExpression[in,yield]:
|
|
33366
33389
|
// 1) ConditionalExpression[?in,?yield]
|
|
33367
33390
|
// 2) LeftHandSideExpression = AssignmentExpression[?in,?yield]
|
|
@@ -33387,7 +33410,7 @@ var ts;
|
|
|
33387
33410
|
// If we do successfully parse arrow-function, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is
|
|
33388
33411
|
// not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done
|
|
33389
33412
|
// with AssignmentExpression if we see one.
|
|
33390
|
-
var arrowExpression = tryParseParenthesizedArrowFunctionExpression(
|
|
33413
|
+
var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();
|
|
33391
33414
|
if (arrowExpression) {
|
|
33392
33415
|
return arrowExpression;
|
|
33393
33416
|
}
|
|
@@ -33406,7 +33429,7 @@ var ts;
|
|
|
33406
33429
|
// parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single
|
|
33407
33430
|
// identifier and the current token is an arrow.
|
|
33408
33431
|
if (expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) {
|
|
33409
|
-
return parseSimpleArrowFunctionExpression(pos, expr, /*asyncModifier*/ undefined
|
|
33432
|
+
return parseSimpleArrowFunctionExpression(pos, expr, /*asyncModifier*/ undefined);
|
|
33410
33433
|
}
|
|
33411
33434
|
// Now see if we might be in cases '2' or '3'.
|
|
33412
33435
|
// If the expression was a LHS expression, and we have an assignment operator, then
|
|
@@ -33466,7 +33489,7 @@ var ts;
|
|
|
33466
33489
|
return finishNode(factory.createYieldExpression(/*asteriskToken*/ undefined, /*expression*/ undefined), pos);
|
|
33467
33490
|
}
|
|
33468
33491
|
}
|
|
33469
|
-
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier
|
|
33492
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {
|
|
33470
33493
|
ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
33471
33494
|
var parameter = factory.createParameterDeclaration(
|
|
33472
33495
|
/*decorators*/ undefined,
|
|
@@ -33478,11 +33501,11 @@ var ts;
|
|
|
33478
33501
|
finishNode(parameter, identifier.pos);
|
|
33479
33502
|
var parameters = createNodeArray([parameter], parameter.pos, parameter.end);
|
|
33480
33503
|
var equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */);
|
|
33481
|
-
var body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier
|
|
33504
|
+
var body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier);
|
|
33482
33505
|
var node = factory.createArrowFunction(asyncModifier, /*typeParameters*/ undefined, parameters, /*type*/ undefined, equalsGreaterThanToken, body);
|
|
33483
33506
|
return addJSDocComment(finishNode(node, pos));
|
|
33484
33507
|
}
|
|
33485
|
-
function tryParseParenthesizedArrowFunctionExpression(
|
|
33508
|
+
function tryParseParenthesizedArrowFunctionExpression() {
|
|
33486
33509
|
var triState = isParenthesizedArrowFunctionExpression();
|
|
33487
33510
|
if (triState === 0 /* False */) {
|
|
33488
33511
|
// It's definitely not a parenthesized arrow function expression.
|
|
@@ -33493,8 +33516,8 @@ var ts;
|
|
|
33493
33516
|
// it out, but don't allow any ambiguity, and return 'undefined' if this could be an
|
|
33494
33517
|
// expression instead.
|
|
33495
33518
|
return triState === 1 /* True */ ?
|
|
33496
|
-
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true
|
|
33497
|
-
tryParse(
|
|
33519
|
+
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true) :
|
|
33520
|
+
tryParse(parsePossibleParenthesizedArrowFunctionExpression);
|
|
33498
33521
|
}
|
|
33499
33522
|
// True -> We definitely expect a parenthesized arrow function here.
|
|
33500
33523
|
// False -> There *cannot* be a parenthesized arrow function here.
|
|
@@ -33624,25 +33647,25 @@ var ts;
|
|
|
33624
33647
|
return 2 /* Unknown */;
|
|
33625
33648
|
}
|
|
33626
33649
|
}
|
|
33627
|
-
function parsePossibleParenthesizedArrowFunctionExpression(
|
|
33650
|
+
function parsePossibleParenthesizedArrowFunctionExpression() {
|
|
33628
33651
|
var tokenPos = scanner.getTokenPos();
|
|
33629
33652
|
if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) {
|
|
33630
33653
|
return undefined;
|
|
33631
33654
|
}
|
|
33632
|
-
var result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false
|
|
33655
|
+
var result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false);
|
|
33633
33656
|
if (!result) {
|
|
33634
33657
|
(notParenthesizedArrow || (notParenthesizedArrow = new ts.Set())).add(tokenPos);
|
|
33635
33658
|
}
|
|
33636
33659
|
return result;
|
|
33637
33660
|
}
|
|
33638
|
-
function tryParseAsyncSimpleArrowFunctionExpression(
|
|
33661
|
+
function tryParseAsyncSimpleArrowFunctionExpression() {
|
|
33639
33662
|
// We do a check here so that we won't be doing unnecessarily call to "lookAhead"
|
|
33640
33663
|
if (token() === 131 /* AsyncKeyword */) {
|
|
33641
33664
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
|
|
33642
33665
|
var pos = getNodePos();
|
|
33643
33666
|
var asyncModifier = parseModifiersForArrowFunction();
|
|
33644
33667
|
var expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
33645
|
-
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier
|
|
33668
|
+
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier);
|
|
33646
33669
|
}
|
|
33647
33670
|
}
|
|
33648
33671
|
return undefined;
|
|
@@ -33666,7 +33689,7 @@ var ts;
|
|
|
33666
33689
|
}
|
|
33667
33690
|
return 0 /* False */;
|
|
33668
33691
|
}
|
|
33669
|
-
function parseParenthesizedArrowFunctionExpression(allowAmbiguity
|
|
33692
|
+
function parseParenthesizedArrowFunctionExpression(allowAmbiguity) {
|
|
33670
33693
|
var pos = getNodePos();
|
|
33671
33694
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
33672
33695
|
var modifiers = parseModifiersForArrowFunction();
|
|
@@ -33692,20 +33715,6 @@ var ts;
|
|
|
33692
33715
|
return undefined;
|
|
33693
33716
|
}
|
|
33694
33717
|
}
|
|
33695
|
-
// Given:
|
|
33696
|
-
// x ? y => ({ y }) : z => ({ z })
|
|
33697
|
-
// We try to parse the body of the first arrow function by looking at:
|
|
33698
|
-
// ({ y }) : z => ({ z })
|
|
33699
|
-
// This is a valid arrow function with "z" as the return type.
|
|
33700
|
-
//
|
|
33701
|
-
// But, if we're in the true side of a conditional expression, this colon
|
|
33702
|
-
// terminates the true side, so cannot be the return type. If we are in the
|
|
33703
|
-
// false side, we may still be within the true side of a parent conditional
|
|
33704
|
-
// expression, so don't allow it to be a return type either.
|
|
33705
|
-
if (parsingConditionalExpression && token() === 58 /* ColonToken */) {
|
|
33706
|
-
ts.Debug.assert(!allowAmbiguity);
|
|
33707
|
-
return undefined;
|
|
33708
|
-
}
|
|
33709
33718
|
var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);
|
|
33710
33719
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
33711
33720
|
return undefined;
|
|
@@ -33739,7 +33748,7 @@ var ts;
|
|
|
33739
33748
|
var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
|
|
33740
33749
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
33741
33750
|
}
|
|
33742
|
-
function parseArrowFunctionExpressionBody(isAsync
|
|
33751
|
+
function parseArrowFunctionExpressionBody(isAsync) {
|
|
33743
33752
|
if (token() === 18 /* OpenBraceToken */) {
|
|
33744
33753
|
return parseFunctionBlock(isAsync ? 2 /* Await */ : 0 /* None */);
|
|
33745
33754
|
}
|
|
@@ -33767,8 +33776,8 @@ var ts;
|
|
|
33767
33776
|
var savedTopLevel = topLevel;
|
|
33768
33777
|
topLevel = false;
|
|
33769
33778
|
var node = isAsync
|
|
33770
|
-
? doInAwaitContext(
|
|
33771
|
-
: doOutsideOfAwaitContext(
|
|
33779
|
+
? doInAwaitContext(parseAssignmentExpressionOrHigher)
|
|
33780
|
+
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
|
|
33772
33781
|
topLevel = savedTopLevel;
|
|
33773
33782
|
return node;
|
|
33774
33783
|
}
|
|
@@ -33781,8 +33790,8 @@ var ts;
|
|
|
33781
33790
|
// Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and
|
|
33782
33791
|
// we do not that for the 'whenFalse' part.
|
|
33783
33792
|
var colonToken;
|
|
33784
|
-
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext,
|
|
33785
|
-
? parseAssignmentExpressionOrHigher(
|
|
33793
|
+
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58 /* ColonToken */), ts.nodeIsPresent(colonToken)
|
|
33794
|
+
? parseAssignmentExpressionOrHigher()
|
|
33786
33795
|
: createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(58 /* ColonToken */))), pos);
|
|
33787
33796
|
}
|
|
33788
33797
|
function parseBinaryExpressionOrHigher(precedence) {
|
|
@@ -34553,12 +34562,16 @@ var ts;
|
|
|
34553
34562
|
expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
|
|
34554
34563
|
continue;
|
|
34555
34564
|
}
|
|
34556
|
-
|
|
34557
|
-
|
|
34558
|
-
|
|
34559
|
-
|
|
34560
|
-
|
|
34561
|
-
|
|
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;
|
|
34562
34575
|
}
|
|
34563
34576
|
}
|
|
34564
34577
|
else if (token() === 20 /* OpenParenToken */) {
|
|
@@ -34598,20 +34611,23 @@ var ts;
|
|
|
34598
34611
|
// If it doesn't have the closing `>` then it's definitely not an type argument list.
|
|
34599
34612
|
return undefined;
|
|
34600
34613
|
}
|
|
34601
|
-
//
|
|
34602
|
-
//
|
|
34603
|
-
|
|
34604
|
-
|
|
34605
|
-
|
|
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;
|
|
34606
34619
|
}
|
|
34607
34620
|
function canFollowTypeArgumentsInExpression() {
|
|
34608
34621
|
switch (token()) {
|
|
34622
|
+
// These tokens can follow a type argument list in a call expression.
|
|
34609
34623
|
case 20 /* OpenParenToken */: // foo<x>(
|
|
34610
34624
|
case 14 /* NoSubstitutionTemplateLiteral */: // foo<T> `...`
|
|
34611
34625
|
case 15 /* TemplateHead */: // foo<T> `...${100}...`
|
|
34612
|
-
//
|
|
34613
|
-
//
|
|
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.
|
|
34614
34629
|
// falls through
|
|
34630
|
+
case 27 /* CommaToken */: // foo<x>,
|
|
34615
34631
|
case 24 /* DotToken */: // foo<x>.
|
|
34616
34632
|
case 21 /* CloseParenToken */: // foo<x>)
|
|
34617
34633
|
case 23 /* CloseBracketToken */: // foo<x>]
|
|
@@ -34630,20 +34646,10 @@ var ts;
|
|
|
34630
34646
|
case 51 /* BarToken */: // foo<x> |
|
|
34631
34647
|
case 19 /* CloseBraceToken */: // foo<x> }
|
|
34632
34648
|
case 1 /* EndOfFileToken */: // foo<x>
|
|
34633
|
-
// these cases can't legally follow a type arg list. However, they're not legal
|
|
34634
|
-
// expressions either. The user is probably in the middle of a generic type. So
|
|
34635
|
-
// treat it as such.
|
|
34636
34649
|
return true;
|
|
34637
|
-
case 27 /* CommaToken */: // foo<x>,
|
|
34638
|
-
case 18 /* OpenBraceToken */: // foo<x> {
|
|
34639
|
-
// We don't want to treat these as type arguments. Otherwise we'll parse this
|
|
34640
|
-
// as an invocation expression. Instead, we want to parse out the expression
|
|
34641
|
-
// in isolation from the type arguments.
|
|
34642
|
-
// falls through
|
|
34643
|
-
default:
|
|
34644
|
-
// Anything else treat as an expression.
|
|
34645
|
-
return false;
|
|
34646
34650
|
}
|
|
34651
|
+
// Treat anything else as an expression.
|
|
34652
|
+
return false;
|
|
34647
34653
|
}
|
|
34648
34654
|
function parsePrimaryExpression() {
|
|
34649
34655
|
switch (token()) {
|
|
@@ -34824,17 +34830,12 @@ var ts;
|
|
|
34824
34830
|
return finishNode(factory.createMetaProperty(103 /* NewKeyword */, name), pos);
|
|
34825
34831
|
}
|
|
34826
34832
|
var expressionPos = getNodePos();
|
|
34827
|
-
var expression = parsePrimaryExpression();
|
|
34828
|
-
var typeArguments;
|
|
34829
|
-
|
|
34830
|
-
|
|
34831
|
-
|
|
34832
|
-
|
|
34833
|
-
ts.Debug.assert(!!typeArguments, "Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'");
|
|
34834
|
-
expression = parseTaggedTemplateRest(expressionPos, expression, /*optionalChain*/ undefined, typeArguments);
|
|
34835
|
-
typeArguments = undefined;
|
|
34836
|
-
}
|
|
34837
|
-
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;
|
|
34838
34839
|
}
|
|
34839
34840
|
var argumentsArray;
|
|
34840
34841
|
if (token() === 20 /* OpenParenToken */) {
|
|
@@ -35931,6 +35932,9 @@ var ts;
|
|
|
35931
35932
|
function parseExpressionWithTypeArguments() {
|
|
35932
35933
|
var pos = getNodePos();
|
|
35933
35934
|
var expression = parseLeftHandSideExpressionOrHigher();
|
|
35935
|
+
if (expression.kind === 227 /* ExpressionWithTypeArguments */) {
|
|
35936
|
+
return expression;
|
|
35937
|
+
}
|
|
35934
35938
|
var typeArguments = tryParseTypeArguments();
|
|
35935
35939
|
return finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
35936
35940
|
}
|
|
@@ -36221,7 +36225,8 @@ var ts;
|
|
|
36221
36225
|
return finishNode(node, pos);
|
|
36222
36226
|
}
|
|
36223
36227
|
function parseExportSpecifier() {
|
|
36224
|
-
|
|
36228
|
+
var hasJSDoc = hasPrecedingJSDocComment();
|
|
36229
|
+
return withJSDoc(parseImportOrExportSpecifier(274 /* ExportSpecifier */), hasJSDoc);
|
|
36225
36230
|
}
|
|
36226
36231
|
function parseImportSpecifier() {
|
|
36227
36232
|
return parseImportOrExportSpecifier(269 /* ImportSpecifier */);
|
|
@@ -43426,14 +43431,12 @@ var ts;
|
|
|
43426
43431
|
}
|
|
43427
43432
|
var binder = createBinder();
|
|
43428
43433
|
function bindSourceFile(file, options) {
|
|
43429
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind" /* Bind */, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
|
|
43430
43434
|
ts.performance.mark("beforeBind");
|
|
43431
43435
|
ts.perfLogger.logStartBindFile("" + file.fileName);
|
|
43432
43436
|
binder(file, options);
|
|
43433
43437
|
ts.perfLogger.logStopBindFile();
|
|
43434
43438
|
ts.performance.mark("afterBind");
|
|
43435
43439
|
ts.performance.measure("Bind", "beforeBind", "afterBind");
|
|
43436
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
43437
43440
|
}
|
|
43438
43441
|
ts.bindSourceFile = bindSourceFile;
|
|
43439
43442
|
function createBinder() {
|
|
@@ -43493,7 +43496,9 @@ var ts;
|
|
|
43493
43496
|
ts.Debug.attachFlowNodeDebugInfo(unreachableFlow);
|
|
43494
43497
|
ts.Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow);
|
|
43495
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);
|
|
43496
43500
|
bind(file);
|
|
43501
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
43497
43502
|
file.symbolCount = symbolCount;
|
|
43498
43503
|
file.classifiableNames = classifiableNames;
|
|
43499
43504
|
delayedBindJSDocTypedefTag();
|
|
@@ -47760,6 +47765,9 @@ var ts;
|
|
|
47760
47765
|
suggestionDiagnostics.add(diagnostic);
|
|
47761
47766
|
return diagnostic;
|
|
47762
47767
|
}
|
|
47768
|
+
function isDeprecatedSymbol(symbol) {
|
|
47769
|
+
return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 134217728 /* Deprecated */);
|
|
47770
|
+
}
|
|
47763
47771
|
function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {
|
|
47764
47772
|
var diagnostic = ts.createDiagnosticForNode(location, ts.Diagnostics._0_is_deprecated, deprecatedEntity);
|
|
47765
47773
|
return addDeprecatedSuggestionWorker(declarations, diagnostic);
|
|
@@ -50855,7 +50863,7 @@ var ts;
|
|
|
50855
50863
|
// get symbol of the first identifier of the entityName
|
|
50856
50864
|
var meaning;
|
|
50857
50865
|
if (entityName.parent.kind === 180 /* TypeQuery */ ||
|
|
50858
|
-
ts.
|
|
50866
|
+
entityName.parent.kind === 227 /* ExpressionWithTypeArguments */ && !ts.isPartOfTypeNode(entityName.parent) ||
|
|
50859
50867
|
entityName.parent.kind === 161 /* ComputedPropertyName */) {
|
|
50860
50868
|
// Typeof value
|
|
50861
50869
|
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
|
|
@@ -50966,7 +50974,7 @@ var ts;
|
|
|
50966
50974
|
return flags & 814775659 /* NodeBuilderFlagsMask */;
|
|
50967
50975
|
}
|
|
50968
50976
|
function isClassInstanceSide(type) {
|
|
50969
|
-
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 */)));
|
|
50970
50978
|
}
|
|
50971
50979
|
function createNodeBuilder() {
|
|
50972
50980
|
return {
|
|
@@ -52530,7 +52538,8 @@ var ts;
|
|
|
52530
52538
|
includePrivateSymbol === null || includePrivateSymbol === void 0 ? void 0 : includePrivateSymbol(sym);
|
|
52531
52539
|
}
|
|
52532
52540
|
if (ts.isIdentifier(node)) {
|
|
52533
|
-
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);
|
|
52534
52543
|
name.symbol = sym; // for quickinfo, which uses identifier symbol information
|
|
52535
52544
|
return { introducesError: introducesError, node: ts.setEmitFlags(ts.setOriginalNode(name, node), 16777216 /* NoAsciiEscaping */) };
|
|
52536
52545
|
}
|
|
@@ -54893,7 +54902,7 @@ var ts;
|
|
|
54893
54902
|
members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.indexInfos);
|
|
54894
54903
|
result.objectFlags |= (ts.getObjectFlags(type) & 8192 /* JSLiteral */); // Propagate JSLiteral flag
|
|
54895
54904
|
if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
54896
|
-
result.objectFlags |=
|
|
54905
|
+
result.objectFlags |= 33554432 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type
|
|
54897
54906
|
}
|
|
54898
54907
|
return result;
|
|
54899
54908
|
}
|
|
@@ -56903,87 +56912,87 @@ var ts;
|
|
|
56903
56912
|
* Converts an AnonymousType to a ResolvedType.
|
|
56904
56913
|
*/
|
|
56905
56914
|
function resolveAnonymousTypeMembers(type) {
|
|
56906
|
-
var symbol = getMergedSymbol(type.symbol);
|
|
56907
56915
|
if (type.target) {
|
|
56908
56916
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
56909
|
-
var
|
|
56917
|
+
var members_6 = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/ false);
|
|
56910
56918
|
var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0 /* Call */), type.mapper);
|
|
56911
56919
|
var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper);
|
|
56912
|
-
var
|
|
56913
|
-
setStructuredTypeMembers(type,
|
|
56920
|
+
var indexInfos_1 = instantiateIndexInfos(getIndexInfosOfType(type.target), type.mapper);
|
|
56921
|
+
setStructuredTypeMembers(type, members_6, callSignatures, constructSignatures, indexInfos_1);
|
|
56922
|
+
return;
|
|
56914
56923
|
}
|
|
56915
|
-
|
|
56924
|
+
var symbol = getMergedSymbol(type.symbol);
|
|
56925
|
+
if (symbol.flags & 2048 /* TypeLiteral */) {
|
|
56916
56926
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
56917
|
-
var
|
|
56918
|
-
var callSignatures = getSignaturesOfSymbol(
|
|
56919
|
-
var constructSignatures = getSignaturesOfSymbol(
|
|
56920
|
-
var
|
|
56921
|
-
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;
|
|
56922
56933
|
}
|
|
56923
|
-
|
|
56924
|
-
|
|
56925
|
-
|
|
56926
|
-
|
|
56927
|
-
|
|
56928
|
-
|
|
56929
|
-
|
|
56930
|
-
|
|
56931
|
-
|
|
56932
|
-
|
|
56933
|
-
|
|
56934
|
-
|
|
56935
|
-
|
|
56936
|
-
members = varsOnly_1;
|
|
56937
|
-
}
|
|
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;
|
|
56938
56947
|
}
|
|
56939
|
-
|
|
56940
|
-
|
|
56941
|
-
|
|
56942
|
-
|
|
56943
|
-
|
|
56944
|
-
|
|
56945
|
-
|
|
56946
|
-
|
|
56947
|
-
|
|
56948
|
-
else if (baseConstructorType === anyType) {
|
|
56949
|
-
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
|
|
56950
|
-
}
|
|
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));
|
|
56951
56957
|
}
|
|
56952
|
-
|
|
56953
|
-
|
|
56954
|
-
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
56958
|
+
else if (baseConstructorType === anyType) {
|
|
56959
|
+
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
|
|
56955
56960
|
}
|
|
56956
|
-
|
|
56957
|
-
|
|
56958
|
-
|
|
56959
|
-
|
|
56960
|
-
|
|
56961
|
-
|
|
56962
|
-
|
|
56963
|
-
|
|
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);
|
|
56964
56969
|
}
|
|
56965
|
-
|
|
56966
|
-
|
|
56967
|
-
|
|
56968
|
-
// in the process of resolving (see issue #6072). The temporarily empty signature list
|
|
56969
|
-
// will never be observed because a qualified name can't reference signatures.
|
|
56970
|
-
if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {
|
|
56971
|
-
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);
|
|
56972
56973
|
}
|
|
56973
|
-
|
|
56974
|
-
|
|
56975
|
-
|
|
56976
|
-
|
|
56977
|
-
|
|
56978
|
-
|
|
56979
|
-
|
|
56980
|
-
|
|
56981
|
-
|
|
56982
|
-
|
|
56983
|
-
|
|
56984
|
-
|
|
56985
|
-
|
|
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);
|
|
56986
56994
|
}
|
|
56995
|
+
type.constructSignatures = constructSignatures;
|
|
56987
56996
|
}
|
|
56988
56997
|
}
|
|
56989
56998
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
@@ -57975,8 +57984,8 @@ var ts;
|
|
|
57975
57984
|
var stringIndexInfo;
|
|
57976
57985
|
var applicableInfo;
|
|
57977
57986
|
var applicableInfos;
|
|
57978
|
-
for (var _i = 0,
|
|
57979
|
-
var info =
|
|
57987
|
+
for (var _i = 0, indexInfos_3 = indexInfos; _i < indexInfos_3.length; _i++) {
|
|
57988
|
+
var info = indexInfos_3[_i];
|
|
57980
57989
|
if (info.keyType === stringType) {
|
|
57981
57990
|
stringIndexInfo = info;
|
|
57982
57991
|
}
|
|
@@ -58540,14 +58549,14 @@ var ts;
|
|
|
58540
58549
|
}
|
|
58541
58550
|
function getIndexInfosOfIndexSymbol(indexSymbol) {
|
|
58542
58551
|
if (indexSymbol.declarations) {
|
|
58543
|
-
var
|
|
58552
|
+
var indexInfos_4 = [];
|
|
58544
58553
|
var _loop_14 = function (declaration) {
|
|
58545
58554
|
if (declaration.parameters.length === 1) {
|
|
58546
58555
|
var parameter = declaration.parameters[0];
|
|
58547
58556
|
if (parameter.type) {
|
|
58548
58557
|
forEachType(getTypeFromTypeNode(parameter.type), function (keyType) {
|
|
58549
|
-
if (isValidIndexKeyType(keyType) && !findIndexInfo(
|
|
58550
|
-
|
|
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));
|
|
58551
58560
|
}
|
|
58552
58561
|
});
|
|
58553
58562
|
}
|
|
@@ -58557,7 +58566,7 @@ var ts;
|
|
|
58557
58566
|
var declaration = _a[_i];
|
|
58558
58567
|
_loop_14(declaration);
|
|
58559
58568
|
}
|
|
58560
|
-
return
|
|
58569
|
+
return indexInfos_4;
|
|
58561
58570
|
}
|
|
58562
58571
|
return ts.emptyArray;
|
|
58563
58572
|
}
|
|
@@ -59105,7 +59114,7 @@ var ts;
|
|
|
59105
59114
|
// The expression is processed as an identifier expression (section 4.3)
|
|
59106
59115
|
// or property access expression(section 4.10),
|
|
59107
59116
|
// the widened type(section 3.9) of which becomes the result.
|
|
59108
|
-
var type =
|
|
59117
|
+
var type = checkExpressionWithTypeArguments(node);
|
|
59109
59118
|
links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(type));
|
|
59110
59119
|
}
|
|
59111
59120
|
return links.resolvedType;
|
|
@@ -60546,7 +60555,7 @@ var ts;
|
|
|
60546
60555
|
}
|
|
60547
60556
|
var prop = getPropertyOfType(objectType, propName);
|
|
60548
60557
|
if (prop) {
|
|
60549
|
-
if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations &&
|
|
60558
|
+
if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations && isDeprecatedSymbol(prop) && isUncalledFunctionReference(accessNode, prop)) {
|
|
60550
60559
|
var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);
|
|
60551
60560
|
addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName);
|
|
60552
60561
|
}
|
|
@@ -61809,7 +61818,9 @@ var ts;
|
|
|
61809
61818
|
return result;
|
|
61810
61819
|
}
|
|
61811
61820
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
61812
|
-
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];
|
|
61813
61824
|
var links = getNodeLinks(declaration);
|
|
61814
61825
|
var target = type.objectFlags & 4 /* Reference */ ? links.resolvedType :
|
|
61815
61826
|
type.objectFlags & 64 /* Instantiated */ ? type.target : type;
|
|
@@ -61825,8 +61836,8 @@ var ts;
|
|
|
61825
61836
|
outerTypeParameters = ts.addRange(outerTypeParameters, templateTagParameters);
|
|
61826
61837
|
}
|
|
61827
61838
|
typeParameters = outerTypeParameters || ts.emptyArray;
|
|
61828
|
-
var allDeclarations_1 = type.objectFlags & 4 /* Reference */ ? [declaration] : type.symbol.declarations;
|
|
61829
|
-
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 ?
|
|
61830
61841
|
ts.filter(typeParameters, function (tp) { return ts.some(allDeclarations_1, function (d) { return isTypeParameterPossiblyReferenced(tp, d); }); }) :
|
|
61831
61842
|
typeParameters;
|
|
61832
61843
|
links.outerTypeParameters = typeParameters;
|
|
@@ -61998,6 +62009,9 @@ var ts;
|
|
|
61998
62009
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
61999
62010
|
freshTypeParameter.mapper = mapper;
|
|
62000
62011
|
}
|
|
62012
|
+
if (type.objectFlags & 16777216 /* InstantiationExpressionType */) {
|
|
62013
|
+
result.node = type.node;
|
|
62014
|
+
}
|
|
62001
62015
|
result.target = type;
|
|
62002
62016
|
result.mapper = mapper;
|
|
62003
62017
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -65172,8 +65186,8 @@ var ts;
|
|
|
65172
65186
|
var indexInfos = getIndexInfosOfType(target);
|
|
65173
65187
|
var targetHasStringIndex = ts.some(indexInfos, function (info) { return info.keyType === stringType; });
|
|
65174
65188
|
var result = -1 /* True */;
|
|
65175
|
-
for (var _i = 0,
|
|
65176
|
-
var targetInfo =
|
|
65189
|
+
for (var _i = 0, indexInfos_5 = indexInfos; _i < indexInfos_5.length; _i++) {
|
|
65190
|
+
var targetInfo = indexInfos_5[_i];
|
|
65177
65191
|
var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ :
|
|
65178
65192
|
isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, 3 /* Both */, reportErrors) :
|
|
65179
65193
|
typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
|
|
@@ -65780,10 +65794,10 @@ var ts;
|
|
|
65780
65794
|
if (!(ts.getObjectFlags(type) & 4 /* Reference */) || !(ts.getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
65781
65795
|
return undefined;
|
|
65782
65796
|
}
|
|
65783
|
-
if (ts.getObjectFlags(type) &
|
|
65784
|
-
return ts.getObjectFlags(type) &
|
|
65797
|
+
if (ts.getObjectFlags(type) & 67108864 /* IdenticalBaseTypeCalculated */) {
|
|
65798
|
+
return ts.getObjectFlags(type) & 134217728 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : undefined;
|
|
65785
65799
|
}
|
|
65786
|
-
type.objectFlags |=
|
|
65800
|
+
type.objectFlags |= 67108864 /* IdenticalBaseTypeCalculated */;
|
|
65787
65801
|
var target = type.target;
|
|
65788
65802
|
if (ts.getObjectFlags(target) & 1 /* Class */) {
|
|
65789
65803
|
var baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -65804,7 +65818,7 @@ var ts;
|
|
|
65804
65818
|
if (ts.length(getTypeArguments(type)) > ts.length(target.typeParameters)) {
|
|
65805
65819
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, ts.last(getTypeArguments(type)));
|
|
65806
65820
|
}
|
|
65807
|
-
type.objectFlags |=
|
|
65821
|
+
type.objectFlags |= 134217728 /* IdenticalBaseTypeExists */;
|
|
65808
65822
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
65809
65823
|
}
|
|
65810
65824
|
function isEmptyLiteralType(type) {
|
|
@@ -66468,7 +66482,7 @@ var ts;
|
|
|
66468
66482
|
var result = !!(type.flags & 465829888 /* Instantiable */ ||
|
|
66469
66483
|
type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) ||
|
|
66470
66484
|
objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations ||
|
|
66471
|
-
objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 8388608 /* ObjectRestType */)) ||
|
|
66485
|
+
objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 8388608 /* ObjectRestType */ | 16777216 /* InstantiationExpressionType */)) ||
|
|
66472
66486
|
type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && ts.some(type.types, couldContainTypeVariables));
|
|
66473
66487
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
66474
66488
|
type.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (result ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
@@ -67385,8 +67399,8 @@ var ts;
|
|
|
67385
67399
|
var priority = (ts.getObjectFlags(source) & ts.getObjectFlags(target) & 32 /* Mapped */) ? 8 /* HomomorphicMappedType */ : 0;
|
|
67386
67400
|
var indexInfos = getIndexInfosOfType(target);
|
|
67387
67401
|
if (isObjectTypeWithInferableIndex(source)) {
|
|
67388
|
-
for (var _i = 0,
|
|
67389
|
-
var targetInfo =
|
|
67402
|
+
for (var _i = 0, indexInfos_6 = indexInfos; _i < indexInfos_6.length; _i++) {
|
|
67403
|
+
var targetInfo = indexInfos_6[_i];
|
|
67390
67404
|
var propTypes = [];
|
|
67391
67405
|
for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) {
|
|
67392
67406
|
var prop = _b[_a];
|
|
@@ -67406,8 +67420,8 @@ var ts;
|
|
|
67406
67420
|
}
|
|
67407
67421
|
}
|
|
67408
67422
|
}
|
|
67409
|
-
for (var _e = 0,
|
|
67410
|
-
var targetInfo =
|
|
67423
|
+
for (var _e = 0, indexInfos_7 = indexInfos; _e < indexInfos_7.length; _e++) {
|
|
67424
|
+
var targetInfo = indexInfos_7[_e];
|
|
67411
67425
|
var sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType);
|
|
67412
67426
|
if (sourceInfo) {
|
|
67413
67427
|
inferWithPriority(sourceInfo.type, targetInfo.type, priority);
|
|
@@ -69949,9 +69963,9 @@ var ts;
|
|
|
69949
69963
|
markAliasReferenced(symbol, node);
|
|
69950
69964
|
}
|
|
69951
69965
|
var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
69952
|
-
var
|
|
69953
|
-
if (
|
|
69954
|
-
addDeprecatedSuggestion(node,
|
|
69966
|
+
var targetSymbol = checkDeprecatedAliasedSymbol(localOrExportSymbol, node);
|
|
69967
|
+
if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
|
|
69968
|
+
addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
|
|
69955
69969
|
}
|
|
69956
69970
|
var declaration = localOrExportSymbol.valueDeclaration;
|
|
69957
69971
|
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
|
|
@@ -72963,7 +72977,7 @@ var ts;
|
|
|
72963
72977
|
}
|
|
72964
72978
|
}
|
|
72965
72979
|
else {
|
|
72966
|
-
if (
|
|
72980
|
+
if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
|
|
72967
72981
|
addDeprecatedSuggestion(right, prop.declarations, right.escapedText);
|
|
72968
72982
|
}
|
|
72969
72983
|
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
|
|
@@ -74422,7 +74436,7 @@ var ts;
|
|
|
74422
74436
|
}
|
|
74423
74437
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
74424
74438
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
74425
|
-
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);
|
|
74426
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
|
|
74427
74441
|
// arrays and the emptyArray singleton where possible, which is decidedly not what we want while we're still constructing this diagnostic
|
|
74428
74442
|
var related = __spreadArray([], ts.flatMap(diags_3, function (d) { return d.relatedInformation; }), true);
|
|
@@ -75577,6 +75591,66 @@ var ts;
|
|
|
75577
75591
|
return node.flags & 32 /* OptionalChain */ ? checkNonNullChain(node) :
|
|
75578
75592
|
getNonNullableType(checkExpression(node.expression));
|
|
75579
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
|
+
}
|
|
75580
75654
|
function checkMetaProperty(node) {
|
|
75581
75655
|
checkGrammarMetaProperty(node);
|
|
75582
75656
|
if (node.keywordToken === 103 /* NewKeyword */) {
|
|
@@ -78086,6 +78160,8 @@ var ts;
|
|
|
78086
78160
|
return checkAssertion(node);
|
|
78087
78161
|
case 229 /* NonNullExpression */:
|
|
78088
78162
|
return checkNonNullAssertion(node);
|
|
78163
|
+
case 227 /* ExpressionWithTypeArguments */:
|
|
78164
|
+
return checkExpressionWithTypeArguments(node);
|
|
78089
78165
|
case 230 /* MetaProperty */:
|
|
78090
78166
|
return checkMetaProperty(node);
|
|
78091
78167
|
case 214 /* DeleteExpression */:
|
|
@@ -79291,12 +79367,12 @@ var ts;
|
|
|
79291
79367
|
case 264 /* ImportEqualsDeclaration */:
|
|
79292
79368
|
case 267 /* NamespaceImport */:
|
|
79293
79369
|
case 266 /* ImportClause */:
|
|
79294
|
-
var
|
|
79370
|
+
var result_12 = 0 /* None */;
|
|
79295
79371
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
79296
79372
|
ts.forEach(target.declarations, function (d) {
|
|
79297
|
-
|
|
79373
|
+
result_12 |= getDeclarationSpaces(d);
|
|
79298
79374
|
});
|
|
79299
|
-
return
|
|
79375
|
+
return result_12;
|
|
79300
79376
|
case 253 /* VariableDeclaration */:
|
|
79301
79377
|
case 202 /* BindingElement */:
|
|
79302
79378
|
case 255 /* FunctionDeclaration */:
|
|
@@ -81883,8 +81959,8 @@ var ts;
|
|
|
81883
81959
|
}
|
|
81884
81960
|
}
|
|
81885
81961
|
if (indexInfos.length > 1) {
|
|
81886
|
-
for (var _d = 0,
|
|
81887
|
-
var info =
|
|
81962
|
+
for (var _d = 0, indexInfos_8 = indexInfos; _d < indexInfos_8.length; _d++) {
|
|
81963
|
+
var info = indexInfos_8[_d];
|
|
81888
81964
|
checkIndexConstraintForIndexSignature(type, info);
|
|
81889
81965
|
}
|
|
81890
81966
|
}
|
|
@@ -81910,8 +81986,8 @@ var ts;
|
|
|
81910
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));
|
|
81911
81987
|
}
|
|
81912
81988
|
};
|
|
81913
|
-
for (var _i = 0,
|
|
81914
|
-
var info =
|
|
81989
|
+
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
81990
|
+
var info = indexInfos_9[_i];
|
|
81915
81991
|
_loop_27(info);
|
|
81916
81992
|
}
|
|
81917
81993
|
}
|
|
@@ -81933,8 +82009,8 @@ var ts;
|
|
|
81933
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));
|
|
81934
82010
|
}
|
|
81935
82011
|
};
|
|
81936
|
-
for (var _i = 0,
|
|
81937
|
-
var info =
|
|
82012
|
+
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
82013
|
+
var info = indexInfos_10[_i];
|
|
81938
82014
|
_loop_28(info);
|
|
81939
82015
|
}
|
|
81940
82016
|
}
|
|
@@ -82801,16 +82877,15 @@ var ts;
|
|
|
82801
82877
|
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
|
|
82802
82878
|
case 206 /* ElementAccessExpression */:
|
|
82803
82879
|
case 205 /* PropertyAccessExpression */:
|
|
82804
|
-
|
|
82805
|
-
|
|
82806
|
-
var type = getTypeOfExpression(ex.expression);
|
|
82880
|
+
if (isConstantMemberAccess(expr)) {
|
|
82881
|
+
var type = getTypeOfExpression(expr.expression);
|
|
82807
82882
|
if (type.symbol && type.symbol.flags & 384 /* Enum */) {
|
|
82808
82883
|
var name = void 0;
|
|
82809
|
-
if (
|
|
82810
|
-
name =
|
|
82884
|
+
if (expr.kind === 205 /* PropertyAccessExpression */) {
|
|
82885
|
+
name = expr.name.escapedText;
|
|
82811
82886
|
}
|
|
82812
82887
|
else {
|
|
82813
|
-
name = ts.escapeLeadingUnderscores(ts.cast(
|
|
82888
|
+
name = ts.escapeLeadingUnderscores(ts.cast(expr.argumentExpression, ts.isLiteralExpression).text);
|
|
82814
82889
|
}
|
|
82815
82890
|
return evaluateEnumMember(expr, type.symbol, name);
|
|
82816
82891
|
}
|
|
@@ -82838,6 +82913,10 @@ var ts;
|
|
|
82838
82913
|
}
|
|
82839
82914
|
}
|
|
82840
82915
|
function isConstantMemberAccess(node) {
|
|
82916
|
+
var type = getTypeOfExpression(node);
|
|
82917
|
+
if (type === errorType) {
|
|
82918
|
+
return false;
|
|
82919
|
+
}
|
|
82841
82920
|
return node.kind === 79 /* Identifier */ ||
|
|
82842
82921
|
node.kind === 205 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) ||
|
|
82843
82922
|
node.kind === 206 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) &&
|
|
@@ -83132,7 +83211,6 @@ var ts;
|
|
|
83132
83211
|
return true;
|
|
83133
83212
|
}
|
|
83134
83213
|
function checkAliasSymbol(node) {
|
|
83135
|
-
var _a;
|
|
83136
83214
|
var symbol = getSymbolOfNode(node);
|
|
83137
83215
|
var target = resolveAlias(symbol);
|
|
83138
83216
|
if (target !== unknownSymbol) {
|
|
@@ -83188,11 +83266,46 @@ var ts;
|
|
|
83188
83266
|
}
|
|
83189
83267
|
}
|
|
83190
83268
|
}
|
|
83191
|
-
if (ts.isImportSpecifier(node)
|
|
83192
|
-
|
|
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
|
+
}
|
|
83193
83274
|
}
|
|
83194
83275
|
}
|
|
83195
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
|
+
}
|
|
83196
83309
|
function checkImportBinding(node) {
|
|
83197
83310
|
checkCollisionsForDeclarationName(node, node.name);
|
|
83198
83311
|
checkAliasSymbol(node);
|
|
@@ -87493,7 +87606,7 @@ var ts;
|
|
|
87493
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));
|
|
87494
87607
|
case 180 /* TypeQuery */:
|
|
87495
87608
|
ts.Debug.type(node);
|
|
87496
|
-
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));
|
|
87497
87610
|
case 181 /* TypeLiteral */:
|
|
87498
87611
|
ts.Debug.type(node);
|
|
87499
87612
|
return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
|
|
@@ -90385,8 +90498,8 @@ var ts;
|
|
|
90385
90498
|
function generateClassElementDecorationExpressions(node, isStatic) {
|
|
90386
90499
|
var members = getDecoratedClassElements(node, isStatic);
|
|
90387
90500
|
var expressions;
|
|
90388
|
-
for (var _i = 0,
|
|
90389
|
-
var member =
|
|
90501
|
+
for (var _i = 0, members_8 = members; _i < members_8.length; _i++) {
|
|
90502
|
+
var member = members_8[_i];
|
|
90390
90503
|
var expression = generateClassElementDecorationExpression(node, member);
|
|
90391
90504
|
if (expression) {
|
|
90392
90505
|
if (!expressions) {
|
|
@@ -95587,8 +95700,8 @@ var ts;
|
|
|
95587
95700
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
95588
95701
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
95589
95702
|
if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
|
|
95590
|
-
var
|
|
95591
|
-
return
|
|
95703
|
+
var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
95704
|
+
return result_13 && factory.createPropertyAssignment("children", result_13);
|
|
95592
95705
|
}
|
|
95593
95706
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
95594
95707
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -109217,6 +109330,8 @@ var ts;
|
|
|
109217
109330
|
return emitAsExpression(node);
|
|
109218
109331
|
case 229 /* NonNullExpression */:
|
|
109219
109332
|
return emitNonNullExpression(node);
|
|
109333
|
+
case 227 /* ExpressionWithTypeArguments */:
|
|
109334
|
+
return emitExpressionWithTypeArguments(node);
|
|
109220
109335
|
case 230 /* MetaProperty */:
|
|
109221
109336
|
return emitMetaProperty(node);
|
|
109222
109337
|
case 231 /* SyntheticExpression */:
|
|
@@ -109661,6 +109776,7 @@ var ts;
|
|
|
109661
109776
|
writeKeyword("typeof");
|
|
109662
109777
|
writeSpace();
|
|
109663
109778
|
emit(node.exprName);
|
|
109779
|
+
emitTypeArguments(node, node.typeArguments);
|
|
109664
109780
|
}
|
|
109665
109781
|
function emitTypeLiteral(node) {
|
|
109666
109782
|
writePunctuation("{");
|
|
@@ -114620,15 +114736,15 @@ var ts;
|
|
|
114620
114736
|
// which per above occurred during the current program creation.
|
|
114621
114737
|
// Since we assume the filesystem does not change during program creation,
|
|
114622
114738
|
// it is safe to reuse resolutions from the earlier call.
|
|
114623
|
-
var
|
|
114739
|
+
var result_14 = [];
|
|
114624
114740
|
var i = 0;
|
|
114625
114741
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
114626
114742
|
var moduleName = moduleNames_1[_i];
|
|
114627
114743
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
114628
114744
|
i++;
|
|
114629
|
-
|
|
114745
|
+
result_14.push(resolvedModule);
|
|
114630
114746
|
}
|
|
114631
|
-
return
|
|
114747
|
+
return result_14;
|
|
114632
114748
|
}
|
|
114633
114749
|
// At this point, we know at least one of the following hold:
|
|
114634
114750
|
// - file has local declarations for ambient modules
|
|
@@ -115850,14 +115966,14 @@ var ts;
|
|
|
115850
115966
|
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
|
115851
115967
|
addFileToFilesByName(dupFile, path, redirectedPath);
|
|
115852
115968
|
addFileIncludeReason(dupFile, reason);
|
|
115853
|
-
sourceFileToPackageName.set(path, packageId
|
|
115969
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
115854
115970
|
processingOtherFiles.push(dupFile);
|
|
115855
115971
|
return dupFile;
|
|
115856
115972
|
}
|
|
115857
115973
|
else if (file) {
|
|
115858
115974
|
// This is the first source file to have this packageId.
|
|
115859
115975
|
packageIdToSourceFile.set(packageIdKey, file);
|
|
115860
|
-
sourceFileToPackageName.set(path, packageId
|
|
115976
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
115861
115977
|
}
|
|
115862
115978
|
}
|
|
115863
115979
|
addFileToFilesByName(file, path, redirectedPath);
|
|
@@ -119736,9 +119852,9 @@ var ts;
|
|
|
119736
119852
|
if (!preferSymlinks) {
|
|
119737
119853
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
119738
119854
|
// so we only need to remove them from the realpath filenames.
|
|
119739
|
-
var
|
|
119740
|
-
if (
|
|
119741
|
-
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;
|
|
119742
119858
|
}
|
|
119743
119859
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
119744
119860
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -119758,10 +119874,10 @@ var ts;
|
|
|
119758
119874
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
119759
119875
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
119760
119876
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
119761
|
-
var
|
|
119877
|
+
var result_16 = cb(option, target === referenceRedirect);
|
|
119762
119878
|
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
119763
|
-
if (
|
|
119764
|
-
return
|
|
119879
|
+
if (result_16)
|
|
119880
|
+
return result_16;
|
|
119765
119881
|
}
|
|
119766
119882
|
});
|
|
119767
119883
|
});
|