typescript 4.7.0-dev.20220216 → 4.7.0-dev.20220217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +241 -165
- package/lib/tsserver.js +266 -195
- package/lib/tsserverlibrary.d.ts +7 -7
- package/lib/tsserverlibrary.js +266 -195
- package/lib/typescript.d.ts +7 -7
- package/lib/typescript.js +266 -195
- package/lib/typescriptServices.d.ts +7 -7
- package/lib/typescriptServices.js +266 -195
- package/lib/typingsInstaller.js +264 -193
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220217";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -4920,13 +4920,14 @@ var ts;
|
|
|
4920
4920
|
// Flags that require TypeFlags.Object
|
|
4921
4921
|
ObjectFlags[ObjectFlags["ContainsSpread"] = 4194304] = "ContainsSpread";
|
|
4922
4922
|
ObjectFlags[ObjectFlags["ObjectRestType"] = 8388608] = "ObjectRestType";
|
|
4923
|
+
ObjectFlags[ObjectFlags["InstantiationExpressionType"] = 16777216] = "InstantiationExpressionType";
|
|
4923
4924
|
/* @internal */
|
|
4924
|
-
ObjectFlags[ObjectFlags["IsClassInstanceClone"] =
|
|
4925
|
+
ObjectFlags[ObjectFlags["IsClassInstanceClone"] = 33554432] = "IsClassInstanceClone";
|
|
4925
4926
|
// Flags that require TypeFlags.Object and ObjectFlags.Reference
|
|
4926
4927
|
/* @internal */
|
|
4927
|
-
ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] =
|
|
4928
|
+
ObjectFlags[ObjectFlags["IdenticalBaseTypeCalculated"] = 67108864] = "IdenticalBaseTypeCalculated";
|
|
4928
4929
|
/* @internal */
|
|
4929
|
-
ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] =
|
|
4930
|
+
ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] = 134217728] = "IdenticalBaseTypeExists";
|
|
4930
4931
|
// Flags that require TypeFlags.UnionOrIntersection or TypeFlags.Substitution
|
|
4931
4932
|
/* @internal */
|
|
4932
4933
|
ObjectFlags[ObjectFlags["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
|
|
@@ -8144,7 +8145,6 @@ var ts;
|
|
|
8144
8145
|
Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
|
|
8145
8146
|
Unexpected_token_Did_you_mean_or_gt: diag(1382, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"),
|
|
8146
8147
|
Only_named_exports_may_use_export_type: diag(1383, ts.DiagnosticCategory.Error, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."),
|
|
8147
|
-
A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list: diag(1384, ts.DiagnosticCategory.Error, "A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384", "A 'new' expression with type arguments must always be followed by a parenthesized argument list."),
|
|
8148
8148
|
Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."),
|
|
8149
8149
|
Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."),
|
|
8150
8150
|
Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."),
|
|
@@ -8530,6 +8530,7 @@ var ts;
|
|
|
8530
8530
|
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."),
|
|
8531
8531
|
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"),
|
|
8532
8532
|
_0_index_signatures_are_incompatible: diag(2634, ts.DiagnosticCategory.Error, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."),
|
|
8533
|
+
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."),
|
|
8533
8534
|
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."),
|
|
8534
8535
|
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."),
|
|
8535
8536
|
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."),
|
|
@@ -13421,6 +13422,7 @@ var ts;
|
|
|
13421
13422
|
case 110 /* TrueKeyword */:
|
|
13422
13423
|
case 106 /* SuperKeyword */:
|
|
13423
13424
|
case 229 /* NonNullExpression */:
|
|
13425
|
+
case 227 /* ExpressionWithTypeArguments */:
|
|
13424
13426
|
case 230 /* MetaProperty */:
|
|
13425
13427
|
case 100 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression
|
|
13426
13428
|
return true;
|
|
@@ -15134,7 +15136,7 @@ var ts;
|
|
|
15134
15136
|
case 114 /* VoidKeyword */:
|
|
15135
15137
|
return node.parent.kind !== 216 /* VoidExpression */;
|
|
15136
15138
|
case 227 /* ExpressionWithTypeArguments */:
|
|
15137
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
15139
|
+
return ts.isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
15138
15140
|
case 162 /* TypeParameter */:
|
|
15139
15141
|
return node.parent.kind === 194 /* MappedType */ || node.parent.kind === 189 /* InferType */;
|
|
15140
15142
|
// Identifiers and qualified names may be type nodes, depending on their context. Climb
|
|
@@ -15171,7 +15173,7 @@ var ts;
|
|
|
15171
15173
|
}
|
|
15172
15174
|
switch (parent.kind) {
|
|
15173
15175
|
case 227 /* ExpressionWithTypeArguments */:
|
|
15174
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
15176
|
+
return ts.isHeritageClause(parent.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
15175
15177
|
case 162 /* TypeParameter */:
|
|
15176
15178
|
return node === parent.constraint;
|
|
15177
15179
|
case 342 /* JSDocTemplateTag */:
|
|
@@ -15874,7 +15876,7 @@ var ts;
|
|
|
15874
15876
|
case 296 /* SpreadAssignment */:
|
|
15875
15877
|
return true;
|
|
15876
15878
|
case 227 /* ExpressionWithTypeArguments */:
|
|
15877
|
-
return parent.expression === node &&
|
|
15879
|
+
return parent.expression === node && !isPartOfTypeNode(parent);
|
|
15878
15880
|
case 295 /* ShorthandPropertyAssignment */:
|
|
15879
15881
|
return parent.objectAssignmentInitializer === node;
|
|
15880
15882
|
default:
|
|
@@ -22861,16 +22863,18 @@ var ts;
|
|
|
22861
22863
|
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
|
|
22862
22864
|
}
|
|
22863
22865
|
// @api
|
|
22864
|
-
function createTypeQueryNode(exprName) {
|
|
22866
|
+
function createTypeQueryNode(exprName, typeArguments) {
|
|
22865
22867
|
var node = createBaseNode(180 /* TypeQuery */);
|
|
22866
22868
|
node.exprName = exprName;
|
|
22869
|
+
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
22867
22870
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
22868
22871
|
return node;
|
|
22869
22872
|
}
|
|
22870
22873
|
// @api
|
|
22871
|
-
function updateTypeQueryNode(node, exprName) {
|
|
22874
|
+
function updateTypeQueryNode(node, exprName, typeArguments) {
|
|
22872
22875
|
return node.exprName !== exprName
|
|
22873
|
-
|
|
22876
|
+
|| node.typeArguments !== typeArguments
|
|
22877
|
+
? update(createTypeQueryNode(exprName, typeArguments), node)
|
|
22874
22878
|
: node;
|
|
22875
22879
|
}
|
|
22876
22880
|
// @api
|
|
@@ -29994,7 +29998,8 @@ var ts;
|
|
|
29994
29998
|
visitNode(cbNode, node.parameterName) ||
|
|
29995
29999
|
visitNode(cbNode, node.type);
|
|
29996
30000
|
case 180 /* TypeQuery */:
|
|
29997
|
-
return visitNode(cbNode, node.exprName)
|
|
30001
|
+
return visitNode(cbNode, node.exprName) ||
|
|
30002
|
+
visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
29998
30003
|
case 181 /* TypeLiteral */:
|
|
29999
30004
|
return visitNodes(cbNode, cbNodes, node.members);
|
|
30000
30005
|
case 182 /* ArrayType */:
|
|
@@ -32527,7 +32532,9 @@ var ts;
|
|
|
32527
32532
|
function parseTypeQuery() {
|
|
32528
32533
|
var pos = getNodePos();
|
|
32529
32534
|
parseExpected(112 /* TypeOfKeyword */);
|
|
32530
|
-
|
|
32535
|
+
var entityName = parseEntityName(/*allowReservedWords*/ true, /*allowPrivateIdentifiers*/ true);
|
|
32536
|
+
var typeArguments = tryParseTypeArguments();
|
|
32537
|
+
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
32531
32538
|
}
|
|
32532
32539
|
function parseTypeParameter() {
|
|
32533
32540
|
var pos = getNodePos();
|
|
@@ -34597,20 +34604,30 @@ var ts;
|
|
|
34597
34604
|
expression = parsePropertyAccessExpressionRest(pos, expression, questionDotToken);
|
|
34598
34605
|
continue;
|
|
34599
34606
|
}
|
|
34600
|
-
if (!questionDotToken && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) {
|
|
34601
|
-
nextToken();
|
|
34602
|
-
expression = finishNode(factory.createNonNullExpression(expression), pos);
|
|
34603
|
-
continue;
|
|
34604
|
-
}
|
|
34605
34607
|
// when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName
|
|
34606
34608
|
if ((questionDotToken || !inDecoratorContext()) && parseOptional(22 /* OpenBracketToken */)) {
|
|
34607
34609
|
expression = parseElementAccessExpressionRest(pos, expression, questionDotToken);
|
|
34608
34610
|
continue;
|
|
34609
34611
|
}
|
|
34610
34612
|
if (isTemplateStartOfTaggedTemplate()) {
|
|
34611
|
-
|
|
34613
|
+
// Absorb type arguments into TemplateExpression when preceding expression is ExpressionWithTypeArguments
|
|
34614
|
+
expression = !questionDotToken && expression.kind === 227 /* ExpressionWithTypeArguments */ ?
|
|
34615
|
+
parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) :
|
|
34616
|
+
parseTaggedTemplateRest(pos, expression, questionDotToken, /*typeArguments*/ undefined);
|
|
34612
34617
|
continue;
|
|
34613
34618
|
}
|
|
34619
|
+
if (!questionDotToken) {
|
|
34620
|
+
if (token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) {
|
|
34621
|
+
nextToken();
|
|
34622
|
+
expression = finishNode(factory.createNonNullExpression(expression), pos);
|
|
34623
|
+
continue;
|
|
34624
|
+
}
|
|
34625
|
+
var typeArguments = tryParse(parseTypeArgumentsInExpression);
|
|
34626
|
+
if (typeArguments) {
|
|
34627
|
+
expression = finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
34628
|
+
continue;
|
|
34629
|
+
}
|
|
34630
|
+
}
|
|
34614
34631
|
return expression;
|
|
34615
34632
|
}
|
|
34616
34633
|
}
|
|
@@ -34630,38 +34647,30 @@ var ts;
|
|
|
34630
34647
|
function parseCallExpressionRest(pos, expression) {
|
|
34631
34648
|
while (true) {
|
|
34632
34649
|
expression = parseMemberExpressionRest(pos, expression, /*allowOptionalChain*/ true);
|
|
34650
|
+
var typeArguments = void 0;
|
|
34633
34651
|
var questionDotToken = parseOptionalToken(28 /* QuestionDotToken */);
|
|
34634
|
-
|
|
34635
|
-
|
|
34636
|
-
|
|
34637
|
-
|
|
34638
|
-
// keep checking for postfix expressions. Otherwise, it's just a '<' that's
|
|
34639
|
-
// part of an arithmetic expression. Break out so we consume it higher in the
|
|
34640
|
-
// stack.
|
|
34641
|
-
var typeArguments = tryParse(parseTypeArgumentsInExpression);
|
|
34642
|
-
if (typeArguments) {
|
|
34643
|
-
if (isTemplateStartOfTaggedTemplate()) {
|
|
34644
|
-
expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
|
|
34645
|
-
continue;
|
|
34646
|
-
}
|
|
34647
|
-
var argumentList = parseArgumentList();
|
|
34648
|
-
var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
34649
|
-
factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
|
|
34650
|
-
factory.createCallExpression(expression, typeArguments, argumentList);
|
|
34651
|
-
expression = finishNode(callExpr, pos);
|
|
34652
|
+
if (questionDotToken) {
|
|
34653
|
+
typeArguments = tryParse(parseTypeArgumentsInExpression);
|
|
34654
|
+
if (isTemplateStartOfTaggedTemplate()) {
|
|
34655
|
+
expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
|
|
34652
34656
|
continue;
|
|
34653
34657
|
}
|
|
34654
34658
|
}
|
|
34655
|
-
|
|
34659
|
+
if (typeArguments || token() === 20 /* OpenParenToken */) {
|
|
34660
|
+
// Absorb type arguments into CallExpression when preceding expression is ExpressionWithTypeArguments
|
|
34661
|
+
if (!questionDotToken && expression.kind === 227 /* ExpressionWithTypeArguments */) {
|
|
34662
|
+
typeArguments = expression.typeArguments;
|
|
34663
|
+
expression = expression.expression;
|
|
34664
|
+
}
|
|
34656
34665
|
var argumentList = parseArgumentList();
|
|
34657
34666
|
var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
34658
|
-
factory.createCallChain(expression, questionDotToken,
|
|
34659
|
-
factory.createCallExpression(expression,
|
|
34667
|
+
factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
|
|
34668
|
+
factory.createCallExpression(expression, typeArguments, argumentList);
|
|
34660
34669
|
expression = finishNode(callExpr, pos);
|
|
34661
34670
|
continue;
|
|
34662
34671
|
}
|
|
34663
34672
|
if (questionDotToken) {
|
|
34664
|
-
// We failed to parse anything, so report a missing identifier here.
|
|
34673
|
+
// We parsed `?.` but then failed to parse anything, so report a missing identifier here.
|
|
34665
34674
|
var name = createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected);
|
|
34666
34675
|
expression = finishNode(factory.createPropertyAccessChain(expression, questionDotToken, name), pos);
|
|
34667
34676
|
}
|
|
@@ -34689,21 +34698,25 @@ var ts;
|
|
|
34689
34698
|
// If it doesn't have the closing `>` then it's definitely not an type argument list.
|
|
34690
34699
|
return undefined;
|
|
34691
34700
|
}
|
|
34692
|
-
//
|
|
34693
|
-
//
|
|
34694
|
-
|
|
34695
|
-
|
|
34696
|
-
|
|
34701
|
+
// We successfully parsed a type argument list. The next token determines whether we want to
|
|
34702
|
+
// treat it as such. If the type argument list is followed by `(` or a template literal, as in
|
|
34703
|
+
// `f<number>(42)`, we favor the type argument interpretation even though JavaScript would view
|
|
34704
|
+
// it as a relational expression.
|
|
34705
|
+
return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined;
|
|
34697
34706
|
}
|
|
34698
34707
|
function canFollowTypeArgumentsInExpression() {
|
|
34699
34708
|
switch (token()) {
|
|
34709
|
+
// These tokens can follow a type argument list in a call expression.
|
|
34700
34710
|
case 20 /* OpenParenToken */: // foo<x>(
|
|
34701
34711
|
case 14 /* NoSubstitutionTemplateLiteral */: // foo<T> `...`
|
|
34702
34712
|
case 15 /* TemplateHead */: // foo<T> `...${100}...`
|
|
34703
|
-
//
|
|
34704
|
-
//
|
|
34713
|
+
// These tokens can't follow in a call expression, nor can they start an
|
|
34714
|
+
// expression. So, consider the type argument list part of an instantiation
|
|
34715
|
+
// expression.
|
|
34705
34716
|
// falls through
|
|
34717
|
+
case 27 /* CommaToken */: // foo<x>,
|
|
34706
34718
|
case 24 /* DotToken */: // foo<x>.
|
|
34719
|
+
case 28 /* QuestionDotToken */: // foo<x>?.
|
|
34707
34720
|
case 21 /* CloseParenToken */: // foo<x>)
|
|
34708
34721
|
case 23 /* CloseBracketToken */: // foo<x>]
|
|
34709
34722
|
case 58 /* ColonToken */: // foo<x>:
|
|
@@ -34721,20 +34734,10 @@ var ts;
|
|
|
34721
34734
|
case 51 /* BarToken */: // foo<x> |
|
|
34722
34735
|
case 19 /* CloseBraceToken */: // foo<x> }
|
|
34723
34736
|
case 1 /* EndOfFileToken */: // foo<x>
|
|
34724
|
-
// these cases can't legally follow a type arg list. However, they're not legal
|
|
34725
|
-
// expressions either. The user is probably in the middle of a generic type. So
|
|
34726
|
-
// treat it as such.
|
|
34727
34737
|
return true;
|
|
34728
|
-
case 27 /* CommaToken */: // foo<x>,
|
|
34729
|
-
case 18 /* OpenBraceToken */: // foo<x> {
|
|
34730
|
-
// We don't want to treat these as type arguments. Otherwise we'll parse this
|
|
34731
|
-
// as an invocation expression. Instead, we want to parse out the expression
|
|
34732
|
-
// in isolation from the type arguments.
|
|
34733
|
-
// falls through
|
|
34734
|
-
default:
|
|
34735
|
-
// Anything else treat as an expression.
|
|
34736
|
-
return false;
|
|
34737
34738
|
}
|
|
34739
|
+
// Treat anything else as an expression.
|
|
34740
|
+
return false;
|
|
34738
34741
|
}
|
|
34739
34742
|
function parsePrimaryExpression() {
|
|
34740
34743
|
switch (token()) {
|
|
@@ -34915,26 +34918,15 @@ var ts;
|
|
|
34915
34918
|
return finishNode(factory.createMetaProperty(103 /* NewKeyword */, name), pos);
|
|
34916
34919
|
}
|
|
34917
34920
|
var expressionPos = getNodePos();
|
|
34918
|
-
var expression = parsePrimaryExpression();
|
|
34921
|
+
var expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), /*allowOptionalChain*/ false);
|
|
34919
34922
|
var typeArguments;
|
|
34920
|
-
|
|
34921
|
-
|
|
34922
|
-
typeArguments =
|
|
34923
|
-
|
|
34924
|
-
ts.Debug.assert(!!typeArguments, "Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'");
|
|
34925
|
-
expression = parseTaggedTemplateRest(expressionPos, expression, /*optionalChain*/ undefined, typeArguments);
|
|
34926
|
-
typeArguments = undefined;
|
|
34927
|
-
}
|
|
34928
|
-
break;
|
|
34929
|
-
}
|
|
34930
|
-
var argumentsArray;
|
|
34931
|
-
if (token() === 20 /* OpenParenToken */) {
|
|
34932
|
-
argumentsArray = parseArgumentList();
|
|
34933
|
-
}
|
|
34934
|
-
else if (typeArguments) {
|
|
34935
|
-
parseErrorAt(pos, scanner.getStartPos(), ts.Diagnostics.A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list);
|
|
34923
|
+
// Absorb type arguments into NewExpression when preceding expression is ExpressionWithTypeArguments
|
|
34924
|
+
if (expression.kind === 227 /* ExpressionWithTypeArguments */) {
|
|
34925
|
+
typeArguments = expression.typeArguments;
|
|
34926
|
+
expression = expression.expression;
|
|
34936
34927
|
}
|
|
34937
|
-
|
|
34928
|
+
var argumentList = token() === 20 /* OpenParenToken */ ? parseArgumentList() : undefined;
|
|
34929
|
+
return finishNode(factory.createNewExpression(expression, typeArguments, argumentList), pos);
|
|
34938
34930
|
}
|
|
34939
34931
|
// STATEMENTS
|
|
34940
34932
|
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
|
|
@@ -36023,6 +36015,9 @@ var ts;
|
|
|
36023
36015
|
function parseExpressionWithTypeArguments() {
|
|
36024
36016
|
var pos = getNodePos();
|
|
36025
36017
|
var expression = parseLeftHandSideExpressionOrHigher();
|
|
36018
|
+
if (expression.kind === 227 /* ExpressionWithTypeArguments */) {
|
|
36019
|
+
return expression;
|
|
36020
|
+
}
|
|
36026
36021
|
var typeArguments = tryParseTypeArguments();
|
|
36027
36022
|
return finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
36028
36023
|
}
|
|
@@ -51031,7 +51026,7 @@ var ts;
|
|
|
51031
51026
|
// get symbol of the first identifier of the entityName
|
|
51032
51027
|
var meaning;
|
|
51033
51028
|
if (entityName.parent.kind === 180 /* TypeQuery */ ||
|
|
51034
|
-
ts.
|
|
51029
|
+
entityName.parent.kind === 227 /* ExpressionWithTypeArguments */ && !ts.isPartOfTypeNode(entityName.parent) ||
|
|
51035
51030
|
entityName.parent.kind === 161 /* ComputedPropertyName */) {
|
|
51036
51031
|
// Typeof value
|
|
51037
51032
|
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
|
|
@@ -51142,7 +51137,7 @@ var ts;
|
|
|
51142
51137
|
return flags & 814775659 /* NodeBuilderFlagsMask */;
|
|
51143
51138
|
}
|
|
51144
51139
|
function isClassInstanceSide(type) {
|
|
51145
|
-
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288 /* Object */) && !!(ts.getObjectFlags(type) &
|
|
51140
|
+
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288 /* Object */) && !!(ts.getObjectFlags(type) & 33554432 /* IsClassInstanceClone */)));
|
|
51146
51141
|
}
|
|
51147
51142
|
function createNodeBuilder() {
|
|
51148
51143
|
return {
|
|
@@ -55071,7 +55066,7 @@ var ts;
|
|
|
55071
55066
|
members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.indexInfos);
|
|
55072
55067
|
result.objectFlags |= (ts.getObjectFlags(type) & 8192 /* JSLiteral */); // Propagate JSLiteral flag
|
|
55073
55068
|
if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
55074
|
-
result.objectFlags |=
|
|
55069
|
+
result.objectFlags |= 33554432 /* IsClassInstanceClone */; // Propagate the knowledge that this type is equivalent to the symbol's class instance type
|
|
55075
55070
|
}
|
|
55076
55071
|
return result;
|
|
55077
55072
|
}
|
|
@@ -57117,87 +57112,87 @@ var ts;
|
|
|
57117
57112
|
* Converts an AnonymousType to a ResolvedType.
|
|
57118
57113
|
*/
|
|
57119
57114
|
function resolveAnonymousTypeMembers(type) {
|
|
57120
|
-
var symbol = getMergedSymbol(type.symbol);
|
|
57121
57115
|
if (type.target) {
|
|
57122
57116
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
57123
|
-
var
|
|
57117
|
+
var members_6 = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, /*mappingThisOnly*/ false);
|
|
57124
57118
|
var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0 /* Call */), type.mapper);
|
|
57125
57119
|
var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1 /* Construct */), type.mapper);
|
|
57126
|
-
var
|
|
57127
|
-
setStructuredTypeMembers(type,
|
|
57120
|
+
var indexInfos_1 = instantiateIndexInfos(getIndexInfosOfType(type.target), type.mapper);
|
|
57121
|
+
setStructuredTypeMembers(type, members_6, callSignatures, constructSignatures, indexInfos_1);
|
|
57122
|
+
return;
|
|
57128
57123
|
}
|
|
57129
|
-
|
|
57124
|
+
var symbol = getMergedSymbol(type.symbol);
|
|
57125
|
+
if (symbol.flags & 2048 /* TypeLiteral */) {
|
|
57130
57126
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
57131
|
-
var
|
|
57132
|
-
var callSignatures = getSignaturesOfSymbol(
|
|
57133
|
-
var constructSignatures = getSignaturesOfSymbol(
|
|
57134
|
-
var
|
|
57135
|
-
setStructuredTypeMembers(type,
|
|
57127
|
+
var members_7 = getMembersOfSymbol(symbol);
|
|
57128
|
+
var callSignatures = getSignaturesOfSymbol(members_7.get("__call" /* Call */));
|
|
57129
|
+
var constructSignatures = getSignaturesOfSymbol(members_7.get("__new" /* New */));
|
|
57130
|
+
var indexInfos_2 = getIndexInfosOfSymbol(symbol);
|
|
57131
|
+
setStructuredTypeMembers(type, members_7, callSignatures, constructSignatures, indexInfos_2);
|
|
57132
|
+
return;
|
|
57136
57133
|
}
|
|
57137
|
-
|
|
57138
|
-
|
|
57139
|
-
|
|
57140
|
-
|
|
57141
|
-
|
|
57142
|
-
|
|
57143
|
-
|
|
57144
|
-
|
|
57145
|
-
|
|
57146
|
-
|
|
57147
|
-
|
|
57148
|
-
|
|
57149
|
-
|
|
57150
|
-
members = varsOnly_1;
|
|
57151
|
-
}
|
|
57134
|
+
// Combinations of function, class, enum and module
|
|
57135
|
+
var members = emptySymbols;
|
|
57136
|
+
var indexInfos;
|
|
57137
|
+
if (symbol.exports) {
|
|
57138
|
+
members = getExportsOfSymbol(symbol);
|
|
57139
|
+
if (symbol === globalThisSymbol) {
|
|
57140
|
+
var varsOnly_1 = new ts.Map();
|
|
57141
|
+
members.forEach(function (p) {
|
|
57142
|
+
if (!(p.flags & 418 /* BlockScoped */)) {
|
|
57143
|
+
varsOnly_1.set(p.escapedName, p);
|
|
57144
|
+
}
|
|
57145
|
+
});
|
|
57146
|
+
members = varsOnly_1;
|
|
57152
57147
|
}
|
|
57153
|
-
|
|
57154
|
-
|
|
57155
|
-
|
|
57156
|
-
|
|
57157
|
-
|
|
57158
|
-
|
|
57159
|
-
|
|
57160
|
-
|
|
57161
|
-
|
|
57162
|
-
else if (baseConstructorType === anyType) {
|
|
57163
|
-
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
|
|
57164
|
-
}
|
|
57148
|
+
}
|
|
57149
|
+
var baseConstructorIndexInfo;
|
|
57150
|
+
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
57151
|
+
if (symbol.flags & 32 /* Class */) {
|
|
57152
|
+
var classType = getDeclaredTypeOfClassOrInterface(symbol);
|
|
57153
|
+
var baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
57154
|
+
if (baseConstructorType.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 8650752 /* TypeVariable */)) {
|
|
57155
|
+
members = ts.createSymbolTable(getNamedOrIndexSignatureMembers(members));
|
|
57156
|
+
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
|
|
57165
57157
|
}
|
|
57166
|
-
|
|
57167
|
-
|
|
57168
|
-
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
57158
|
+
else if (baseConstructorType === anyType) {
|
|
57159
|
+
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, /*isReadonly*/ false);
|
|
57169
57160
|
}
|
|
57170
|
-
|
|
57171
|
-
|
|
57172
|
-
|
|
57173
|
-
|
|
57174
|
-
|
|
57175
|
-
|
|
57176
|
-
|
|
57177
|
-
|
|
57161
|
+
}
|
|
57162
|
+
var indexSymbol = getIndexSymbolFromSymbolTable(members);
|
|
57163
|
+
if (indexSymbol) {
|
|
57164
|
+
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
57165
|
+
}
|
|
57166
|
+
else {
|
|
57167
|
+
if (baseConstructorIndexInfo) {
|
|
57168
|
+
indexInfos = ts.append(indexInfos, baseConstructorIndexInfo);
|
|
57178
57169
|
}
|
|
57179
|
-
|
|
57180
|
-
|
|
57181
|
-
|
|
57182
|
-
// in the process of resolving (see issue #6072). The temporarily empty signature list
|
|
57183
|
-
// will never be observed because a qualified name can't reference signatures.
|
|
57184
|
-
if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {
|
|
57185
|
-
type.callSignatures = getSignaturesOfSymbol(symbol);
|
|
57170
|
+
if (symbol.flags & 384 /* Enum */ && (getDeclaredTypeOfSymbol(symbol).flags & 32 /* Enum */ ||
|
|
57171
|
+
ts.some(type.properties, function (prop) { return !!(getTypeOfSymbol(prop).flags & 296 /* NumberLike */); }))) {
|
|
57172
|
+
indexInfos = ts.append(indexInfos, enumNumberIndexInfo);
|
|
57186
57173
|
}
|
|
57187
|
-
|
|
57188
|
-
|
|
57189
|
-
|
|
57190
|
-
|
|
57191
|
-
|
|
57192
|
-
|
|
57193
|
-
|
|
57194
|
-
|
|
57195
|
-
|
|
57196
|
-
|
|
57197
|
-
|
|
57198
|
-
|
|
57199
|
-
|
|
57174
|
+
}
|
|
57175
|
+
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, indexInfos || ts.emptyArray);
|
|
57176
|
+
// We resolve the members before computing the signatures because a signature may use
|
|
57177
|
+
// typeof with a qualified name expression that circularly references the type we are
|
|
57178
|
+
// in the process of resolving (see issue #6072). The temporarily empty signature list
|
|
57179
|
+
// will never be observed because a qualified name can't reference signatures.
|
|
57180
|
+
if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {
|
|
57181
|
+
type.callSignatures = getSignaturesOfSymbol(symbol);
|
|
57182
|
+
}
|
|
57183
|
+
// And likewise for construct signatures for classes
|
|
57184
|
+
if (symbol.flags & 32 /* Class */) {
|
|
57185
|
+
var classType_1 = getDeclaredTypeOfClassOrInterface(symbol);
|
|
57186
|
+
var constructSignatures = symbol.members ? getSignaturesOfSymbol(symbol.members.get("__constructor" /* Constructor */)) : ts.emptyArray;
|
|
57187
|
+
if (symbol.flags & 16 /* Function */) {
|
|
57188
|
+
constructSignatures = ts.addRange(constructSignatures.slice(), ts.mapDefined(type.callSignatures, function (sig) { return isJSConstructor(sig.declaration) ?
|
|
57189
|
+
createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, classType_1, /*resolvedTypePredicate*/ undefined, sig.minArgumentCount, sig.flags & 39 /* PropagatingFlags */) :
|
|
57190
|
+
undefined; }));
|
|
57191
|
+
}
|
|
57192
|
+
if (!constructSignatures.length) {
|
|
57193
|
+
constructSignatures = getDefaultConstructSignatures(classType_1);
|
|
57200
57194
|
}
|
|
57195
|
+
type.constructSignatures = constructSignatures;
|
|
57201
57196
|
}
|
|
57202
57197
|
}
|
|
57203
57198
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
@@ -58198,8 +58193,8 @@ var ts;
|
|
|
58198
58193
|
var stringIndexInfo;
|
|
58199
58194
|
var applicableInfo;
|
|
58200
58195
|
var applicableInfos;
|
|
58201
|
-
for (var _i = 0,
|
|
58202
|
-
var info =
|
|
58196
|
+
for (var _i = 0, indexInfos_3 = indexInfos; _i < indexInfos_3.length; _i++) {
|
|
58197
|
+
var info = indexInfos_3[_i];
|
|
58203
58198
|
if (info.keyType === stringType) {
|
|
58204
58199
|
stringIndexInfo = info;
|
|
58205
58200
|
}
|
|
@@ -58772,14 +58767,14 @@ var ts;
|
|
|
58772
58767
|
}
|
|
58773
58768
|
function getIndexInfosOfIndexSymbol(indexSymbol) {
|
|
58774
58769
|
if (indexSymbol.declarations) {
|
|
58775
|
-
var
|
|
58770
|
+
var indexInfos_4 = [];
|
|
58776
58771
|
var _loop_14 = function (declaration) {
|
|
58777
58772
|
if (declaration.parameters.length === 1) {
|
|
58778
58773
|
var parameter = declaration.parameters[0];
|
|
58779
58774
|
if (parameter.type) {
|
|
58780
58775
|
forEachType(getTypeFromTypeNode(parameter.type), function (keyType) {
|
|
58781
|
-
if (isValidIndexKeyType(keyType) && !findIndexInfo(
|
|
58782
|
-
|
|
58776
|
+
if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos_4, keyType)) {
|
|
58777
|
+
indexInfos_4.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasEffectiveModifier(declaration, 64 /* Readonly */), declaration));
|
|
58783
58778
|
}
|
|
58784
58779
|
});
|
|
58785
58780
|
}
|
|
@@ -58789,7 +58784,7 @@ var ts;
|
|
|
58789
58784
|
var declaration = _a[_i];
|
|
58790
58785
|
_loop_14(declaration);
|
|
58791
58786
|
}
|
|
58792
|
-
return
|
|
58787
|
+
return indexInfos_4;
|
|
58793
58788
|
}
|
|
58794
58789
|
return ts.emptyArray;
|
|
58795
58790
|
}
|
|
@@ -59337,7 +59332,7 @@ var ts;
|
|
|
59337
59332
|
// The expression is processed as an identifier expression (section 4.3)
|
|
59338
59333
|
// or property access expression(section 4.10),
|
|
59339
59334
|
// the widened type(section 3.9) of which becomes the result.
|
|
59340
|
-
var type =
|
|
59335
|
+
var type = checkExpressionWithTypeArguments(node);
|
|
59341
59336
|
links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(type));
|
|
59342
59337
|
}
|
|
59343
59338
|
return links.resolvedType;
|
|
@@ -62041,7 +62036,9 @@ var ts;
|
|
|
62041
62036
|
return result;
|
|
62042
62037
|
}
|
|
62043
62038
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
62044
|
-
var declaration = type.objectFlags & 4 /* Reference */ ? type.node :
|
|
62039
|
+
var declaration = type.objectFlags & 4 /* Reference */ ? type.node :
|
|
62040
|
+
type.objectFlags & 16777216 /* InstantiationExpressionType */ ? type.node :
|
|
62041
|
+
type.symbol.declarations[0];
|
|
62045
62042
|
var links = getNodeLinks(declaration);
|
|
62046
62043
|
var target = type.objectFlags & 4 /* Reference */ ? links.resolvedType :
|
|
62047
62044
|
type.objectFlags & 64 /* Instantiated */ ? type.target : type;
|
|
@@ -62057,8 +62054,8 @@ var ts;
|
|
|
62057
62054
|
outerTypeParameters = ts.addRange(outerTypeParameters, templateTagParameters);
|
|
62058
62055
|
}
|
|
62059
62056
|
typeParameters = outerTypeParameters || ts.emptyArray;
|
|
62060
|
-
var allDeclarations_1 = type.objectFlags & 4 /* Reference */ ? [declaration] : type.symbol.declarations;
|
|
62061
|
-
typeParameters = (target.objectFlags & 4 /* Reference */ || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ?
|
|
62057
|
+
var allDeclarations_1 = type.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */) ? [declaration] : type.symbol.declarations;
|
|
62058
|
+
typeParameters = (target.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */) || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ?
|
|
62062
62059
|
ts.filter(typeParameters, function (tp) { return ts.some(allDeclarations_1, function (d) { return isTypeParameterPossiblyReferenced(tp, d); }); }) :
|
|
62063
62060
|
typeParameters;
|
|
62064
62061
|
links.outerTypeParameters = typeParameters;
|
|
@@ -62230,6 +62227,9 @@ var ts;
|
|
|
62230
62227
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
62231
62228
|
freshTypeParameter.mapper = mapper;
|
|
62232
62229
|
}
|
|
62230
|
+
if (type.objectFlags & 16777216 /* InstantiationExpressionType */) {
|
|
62231
|
+
result.node = type.node;
|
|
62232
|
+
}
|
|
62233
62233
|
result.target = type;
|
|
62234
62234
|
result.mapper = mapper;
|
|
62235
62235
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -65423,8 +65423,8 @@ var ts;
|
|
|
65423
65423
|
var indexInfos = getIndexInfosOfType(target);
|
|
65424
65424
|
var targetHasStringIndex = ts.some(indexInfos, function (info) { return info.keyType === stringType; });
|
|
65425
65425
|
var result = -1 /* True */;
|
|
65426
|
-
for (var _i = 0,
|
|
65427
|
-
var targetInfo =
|
|
65426
|
+
for (var _i = 0, indexInfos_5 = indexInfos; _i < indexInfos_5.length; _i++) {
|
|
65427
|
+
var targetInfo = indexInfos_5[_i];
|
|
65428
65428
|
var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ :
|
|
65429
65429
|
isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, 3 /* Both */, reportErrors) :
|
|
65430
65430
|
typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
|
|
@@ -66031,10 +66031,10 @@ var ts;
|
|
|
66031
66031
|
if (!(ts.getObjectFlags(type) & 4 /* Reference */) || !(ts.getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
66032
66032
|
return undefined;
|
|
66033
66033
|
}
|
|
66034
|
-
if (ts.getObjectFlags(type) &
|
|
66035
|
-
return ts.getObjectFlags(type) &
|
|
66034
|
+
if (ts.getObjectFlags(type) & 67108864 /* IdenticalBaseTypeCalculated */) {
|
|
66035
|
+
return ts.getObjectFlags(type) & 134217728 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : undefined;
|
|
66036
66036
|
}
|
|
66037
|
-
type.objectFlags |=
|
|
66037
|
+
type.objectFlags |= 67108864 /* IdenticalBaseTypeCalculated */;
|
|
66038
66038
|
var target = type.target;
|
|
66039
66039
|
if (ts.getObjectFlags(target) & 1 /* Class */) {
|
|
66040
66040
|
var baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -66055,7 +66055,7 @@ var ts;
|
|
|
66055
66055
|
if (ts.length(getTypeArguments(type)) > ts.length(target.typeParameters)) {
|
|
66056
66056
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, ts.last(getTypeArguments(type)));
|
|
66057
66057
|
}
|
|
66058
|
-
type.objectFlags |=
|
|
66058
|
+
type.objectFlags |= 134217728 /* IdenticalBaseTypeExists */;
|
|
66059
66059
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
66060
66060
|
}
|
|
66061
66061
|
function isEmptyLiteralType(type) {
|
|
@@ -66719,7 +66719,7 @@ var ts;
|
|
|
66719
66719
|
var result = !!(type.flags & 465829888 /* Instantiable */ ||
|
|
66720
66720
|
type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) ||
|
|
66721
66721
|
objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations ||
|
|
66722
|
-
objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 8388608 /* ObjectRestType */)) ||
|
|
66722
|
+
objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 8388608 /* ObjectRestType */ | 16777216 /* InstantiationExpressionType */)) ||
|
|
66723
66723
|
type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && ts.some(type.types, couldContainTypeVariables));
|
|
66724
66724
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
66725
66725
|
type.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (result ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
@@ -67636,8 +67636,8 @@ var ts;
|
|
|
67636
67636
|
var priority = (ts.getObjectFlags(source) & ts.getObjectFlags(target) & 32 /* Mapped */) ? 8 /* HomomorphicMappedType */ : 0;
|
|
67637
67637
|
var indexInfos = getIndexInfosOfType(target);
|
|
67638
67638
|
if (isObjectTypeWithInferableIndex(source)) {
|
|
67639
|
-
for (var _i = 0,
|
|
67640
|
-
var targetInfo =
|
|
67639
|
+
for (var _i = 0, indexInfos_6 = indexInfos; _i < indexInfos_6.length; _i++) {
|
|
67640
|
+
var targetInfo = indexInfos_6[_i];
|
|
67641
67641
|
var propTypes = [];
|
|
67642
67642
|
for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) {
|
|
67643
67643
|
var prop = _b[_a];
|
|
@@ -67657,8 +67657,8 @@ var ts;
|
|
|
67657
67657
|
}
|
|
67658
67658
|
}
|
|
67659
67659
|
}
|
|
67660
|
-
for (var _e = 0,
|
|
67661
|
-
var targetInfo =
|
|
67660
|
+
for (var _e = 0, indexInfos_7 = indexInfos; _e < indexInfos_7.length; _e++) {
|
|
67661
|
+
var targetInfo = indexInfos_7[_e];
|
|
67662
67662
|
var sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType);
|
|
67663
67663
|
if (sourceInfo) {
|
|
67664
67664
|
inferWithPriority(sourceInfo.type, targetInfo.type, priority);
|
|
@@ -75822,6 +75822,72 @@ var ts;
|
|
|
75822
75822
|
return node.flags & 32 /* OptionalChain */ ? checkNonNullChain(node) :
|
|
75823
75823
|
getNonNullableType(checkExpression(node.expression));
|
|
75824
75824
|
}
|
|
75825
|
+
function checkExpressionWithTypeArguments(node) {
|
|
75826
|
+
checkGrammarExpressionWithTypeArguments(node);
|
|
75827
|
+
var exprType = node.kind === 227 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) :
|
|
75828
|
+
ts.isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) :
|
|
75829
|
+
checkExpression(node.exprName);
|
|
75830
|
+
var typeArguments = node.typeArguments;
|
|
75831
|
+
if (exprType === silentNeverType || isErrorType(exprType) || !ts.some(typeArguments)) {
|
|
75832
|
+
return exprType;
|
|
75833
|
+
}
|
|
75834
|
+
var hasSomeApplicableSignature = false;
|
|
75835
|
+
var nonApplicableType;
|
|
75836
|
+
var result = getInstantiatedType(exprType);
|
|
75837
|
+
var errorType = hasSomeApplicableSignature ? nonApplicableType : exprType;
|
|
75838
|
+
if (errorType) {
|
|
75839
|
+
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)));
|
|
75840
|
+
}
|
|
75841
|
+
return result;
|
|
75842
|
+
function getInstantiatedType(type) {
|
|
75843
|
+
var hasSignatures = false;
|
|
75844
|
+
var hasApplicableSignature = false;
|
|
75845
|
+
var result = getInstantiatedTypePart(type);
|
|
75846
|
+
hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature);
|
|
75847
|
+
if (hasSignatures && !hasApplicableSignature) {
|
|
75848
|
+
nonApplicableType !== null && nonApplicableType !== void 0 ? nonApplicableType : (nonApplicableType = type);
|
|
75849
|
+
}
|
|
75850
|
+
return result;
|
|
75851
|
+
function getInstantiatedTypePart(type) {
|
|
75852
|
+
if (type.flags & 524288 /* Object */) {
|
|
75853
|
+
var resolved = resolveStructuredTypeMembers(type);
|
|
75854
|
+
var callSignatures = getInstantiatedSignatures(resolved.callSignatures);
|
|
75855
|
+
var constructSignatures = getInstantiatedSignatures(resolved.constructSignatures);
|
|
75856
|
+
hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
|
|
75857
|
+
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
75858
|
+
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
75859
|
+
var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
75860
|
+
result_11.objectFlags |= 16777216 /* InstantiationExpressionType */;
|
|
75861
|
+
result_11.node = node;
|
|
75862
|
+
return result_11;
|
|
75863
|
+
}
|
|
75864
|
+
}
|
|
75865
|
+
else if (type.flags & 58982400 /* InstantiableNonPrimitive */) {
|
|
75866
|
+
var constraint = getBaseConstraintOfType(type);
|
|
75867
|
+
if (constraint) {
|
|
75868
|
+
var instantiated = getInstantiatedTypePart(constraint);
|
|
75869
|
+
if (instantiated !== constraint) {
|
|
75870
|
+
return instantiated;
|
|
75871
|
+
}
|
|
75872
|
+
}
|
|
75873
|
+
}
|
|
75874
|
+
else if (type.flags & 1048576 /* Union */) {
|
|
75875
|
+
return mapType(type, getInstantiatedType);
|
|
75876
|
+
}
|
|
75877
|
+
else if (type.flags & 2097152 /* Intersection */) {
|
|
75878
|
+
return getIntersectionType(ts.sameMap(type.types, getInstantiatedTypePart));
|
|
75879
|
+
}
|
|
75880
|
+
return type;
|
|
75881
|
+
}
|
|
75882
|
+
}
|
|
75883
|
+
function getInstantiatedSignatures(signatures) {
|
|
75884
|
+
var applicableSignatures = ts.filter(signatures, function (sig) { return !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments); });
|
|
75885
|
+
return ts.sameMap(applicableSignatures, function (sig) {
|
|
75886
|
+
var typeArgumentTypes = checkTypeArguments(sig, typeArguments, /*reportErrors*/ true);
|
|
75887
|
+
return typeArgumentTypes ? getSignatureInstantiation(sig, typeArgumentTypes, ts.isInJSFile(sig.declaration)) : sig;
|
|
75888
|
+
});
|
|
75889
|
+
}
|
|
75890
|
+
}
|
|
75825
75891
|
function checkMetaProperty(node) {
|
|
75826
75892
|
checkGrammarMetaProperty(node);
|
|
75827
75893
|
if (node.keywordToken === 103 /* NewKeyword */) {
|
|
@@ -78338,6 +78404,8 @@ var ts;
|
|
|
78338
78404
|
return checkAssertion(node);
|
|
78339
78405
|
case 229 /* NonNullExpression */:
|
|
78340
78406
|
return checkNonNullAssertion(node);
|
|
78407
|
+
case 227 /* ExpressionWithTypeArguments */:
|
|
78408
|
+
return checkExpressionWithTypeArguments(node);
|
|
78341
78409
|
case 230 /* MetaProperty */:
|
|
78342
78410
|
return checkMetaProperty(node);
|
|
78343
78411
|
case 214 /* DeleteExpression */:
|
|
@@ -79541,12 +79609,12 @@ var ts;
|
|
|
79541
79609
|
case 264 /* ImportEqualsDeclaration */:
|
|
79542
79610
|
case 267 /* NamespaceImport */:
|
|
79543
79611
|
case 266 /* ImportClause */:
|
|
79544
|
-
var
|
|
79612
|
+
var result_12 = 0 /* None */;
|
|
79545
79613
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
79546
79614
|
ts.forEach(target.declarations, function (d) {
|
|
79547
|
-
|
|
79615
|
+
result_12 |= getDeclarationSpaces(d);
|
|
79548
79616
|
});
|
|
79549
|
-
return
|
|
79617
|
+
return result_12;
|
|
79550
79618
|
case 253 /* VariableDeclaration */:
|
|
79551
79619
|
case 202 /* BindingElement */:
|
|
79552
79620
|
case 255 /* FunctionDeclaration */:
|
|
@@ -82105,8 +82173,8 @@ var ts;
|
|
|
82105
82173
|
}
|
|
82106
82174
|
}
|
|
82107
82175
|
if (indexInfos.length > 1) {
|
|
82108
|
-
for (var _d = 0,
|
|
82109
|
-
var info =
|
|
82176
|
+
for (var _d = 0, indexInfos_8 = indexInfos; _d < indexInfos_8.length; _d++) {
|
|
82177
|
+
var info = indexInfos_8[_d];
|
|
82110
82178
|
checkIndexConstraintForIndexSignature(type, info);
|
|
82111
82179
|
}
|
|
82112
82180
|
}
|
|
@@ -82132,8 +82200,8 @@ var ts;
|
|
|
82132
82200
|
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));
|
|
82133
82201
|
}
|
|
82134
82202
|
};
|
|
82135
|
-
for (var _i = 0,
|
|
82136
|
-
var info =
|
|
82203
|
+
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
82204
|
+
var info = indexInfos_9[_i];
|
|
82137
82205
|
_loop_27(info);
|
|
82138
82206
|
}
|
|
82139
82207
|
}
|
|
@@ -82155,8 +82223,8 @@ var ts;
|
|
|
82155
82223
|
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));
|
|
82156
82224
|
}
|
|
82157
82225
|
};
|
|
82158
|
-
for (var _i = 0,
|
|
82159
|
-
var info =
|
|
82226
|
+
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
82227
|
+
var info = indexInfos_10[_i];
|
|
82160
82228
|
_loop_28(info);
|
|
82161
82229
|
}
|
|
82162
82230
|
}
|
|
@@ -87789,7 +87857,7 @@ var ts;
|
|
|
87789
87857
|
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));
|
|
87790
87858
|
case 180 /* TypeQuery */:
|
|
87791
87859
|
ts.Debug.type(node);
|
|
87792
|
-
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName));
|
|
87860
|
+
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
|
|
87793
87861
|
case 181 /* TypeLiteral */:
|
|
87794
87862
|
ts.Debug.type(node);
|
|
87795
87863
|
return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
|
|
@@ -90681,8 +90749,8 @@ var ts;
|
|
|
90681
90749
|
function generateClassElementDecorationExpressions(node, isStatic) {
|
|
90682
90750
|
var members = getDecoratedClassElements(node, isStatic);
|
|
90683
90751
|
var expressions;
|
|
90684
|
-
for (var _i = 0,
|
|
90685
|
-
var member =
|
|
90752
|
+
for (var _i = 0, members_8 = members; _i < members_8.length; _i++) {
|
|
90753
|
+
var member = members_8[_i];
|
|
90686
90754
|
var expression = generateClassElementDecorationExpression(node, member);
|
|
90687
90755
|
if (expression) {
|
|
90688
90756
|
if (!expressions) {
|
|
@@ -96027,8 +96095,8 @@ var ts;
|
|
|
96027
96095
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
96028
96096
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
96029
96097
|
if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
|
|
96030
|
-
var
|
|
96031
|
-
return
|
|
96098
|
+
var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
96099
|
+
return result_13 && factory.createPropertyAssignment("children", result_13);
|
|
96032
96100
|
}
|
|
96033
96101
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
96034
96102
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -109666,6 +109734,8 @@ var ts;
|
|
|
109666
109734
|
return emitAsExpression(node);
|
|
109667
109735
|
case 229 /* NonNullExpression */:
|
|
109668
109736
|
return emitNonNullExpression(node);
|
|
109737
|
+
case 227 /* ExpressionWithTypeArguments */:
|
|
109738
|
+
return emitExpressionWithTypeArguments(node);
|
|
109669
109739
|
case 230 /* MetaProperty */:
|
|
109670
109740
|
return emitMetaProperty(node);
|
|
109671
109741
|
case 231 /* SyntheticExpression */:
|
|
@@ -110110,6 +110180,7 @@ var ts;
|
|
|
110110
110180
|
writeKeyword("typeof");
|
|
110111
110181
|
writeSpace();
|
|
110112
110182
|
emit(node.exprName);
|
|
110183
|
+
emitTypeArguments(node, node.typeArguments);
|
|
110113
110184
|
}
|
|
110114
110185
|
function emitTypeLiteral(node) {
|
|
110115
110186
|
writePunctuation("{");
|
|
@@ -115083,15 +115154,15 @@ var ts;
|
|
|
115083
115154
|
// which per above occurred during the current program creation.
|
|
115084
115155
|
// Since we assume the filesystem does not change during program creation,
|
|
115085
115156
|
// it is safe to reuse resolutions from the earlier call.
|
|
115086
|
-
var
|
|
115157
|
+
var result_14 = [];
|
|
115087
115158
|
var i = 0;
|
|
115088
115159
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
115089
115160
|
var moduleName = moduleNames_1[_i];
|
|
115090
115161
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
115091
115162
|
i++;
|
|
115092
|
-
|
|
115163
|
+
result_14.push(resolvedModule);
|
|
115093
115164
|
}
|
|
115094
|
-
return
|
|
115165
|
+
return result_14;
|
|
115095
115166
|
}
|
|
115096
115167
|
// At this point, we know at least one of the following hold:
|
|
115097
115168
|
// - file has local declarations for ambient modules
|
|
@@ -120209,9 +120280,9 @@ var ts;
|
|
|
120209
120280
|
if (!preferSymlinks) {
|
|
120210
120281
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
120211
120282
|
// so we only need to remove them from the realpath filenames.
|
|
120212
|
-
var
|
|
120213
|
-
if (
|
|
120214
|
-
return
|
|
120283
|
+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
120284
|
+
if (result_15)
|
|
120285
|
+
return result_15;
|
|
120215
120286
|
}
|
|
120216
120287
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
120217
120288
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -120231,10 +120302,10 @@ var ts;
|
|
|
120231
120302
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
120232
120303
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
120233
120304
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
120234
|
-
var
|
|
120305
|
+
var result_16 = cb(option, target === referenceRedirect);
|
|
120235
120306
|
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
120236
|
-
if (
|
|
120237
|
-
return
|
|
120307
|
+
if (result_16)
|
|
120308
|
+
return result_16;
|
|
120238
120309
|
}
|
|
120239
120310
|
});
|
|
120240
120311
|
});
|
|
@@ -124075,7 +124146,7 @@ var ts;
|
|
|
124075
124146
|
case 199 /* ImportType */:
|
|
124076
124147
|
return !node.parent.isTypeOf;
|
|
124077
124148
|
case 227 /* ExpressionWithTypeArguments */:
|
|
124078
|
-
return
|
|
124149
|
+
return ts.isPartOfTypeNode(node.parent);
|
|
124079
124150
|
}
|
|
124080
124151
|
return false;
|
|
124081
124152
|
}
|
|
@@ -157018,7 +157089,7 @@ var ts;
|
|
|
157018
157089
|
// cannot find either start or end node
|
|
157019
157090
|
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] };
|
|
157020
157091
|
}
|
|
157021
|
-
if (
|
|
157092
|
+
if (start.flags & 4194304 /* JSDoc */) {
|
|
157022
157093
|
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractJSDoc)] };
|
|
157023
157094
|
}
|
|
157024
157095
|
if (start.parent !== end.parent) {
|