@@ -1054,7 +1054,7 @@ namespace ts {
1054
1054
if (node.moduleReference.kind === SyntaxKind.ExternalModuleReference) {
1055
1055
return resolveExternalModuleSymbol(resolveExternalModuleName(node, getExternalModuleImportEqualsDeclarationExpression(node)));
1056
1056
}
1057
- return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>node.moduleReference, node );
1057
+ return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>node.moduleReference);
1058
1058
}
1059
1059
1060
1060
function getTargetOfImportClause(node: ImportClause): Symbol {
@@ -1267,7 +1267,7 @@ namespace ts {
1267
1267
}
1268
1268
1269
1269
// This function is only for imports with entity names
1270
- function getSymbolOfPartOfRightHandSideOfImportEquals(entityName: EntityName, importDeclaration: ImportEqualsDeclaration, dontResolveAlias?: boolean): Symbol {
1270
+ function getSymbolOfPartOfRightHandSideOfImportEquals(entityName: EntityName, dontResolveAlias?: boolean): Symbol {
1271
1271
// There are three things we might try to look for. In the following examples,
1272
1272
// the search term is enclosed in |...|:
1273
1273
//
@@ -2583,7 +2583,7 @@ namespace ts {
2583
2583
}
2584
2584
}
2585
2585
2586
- function buildDisplayForTypeArgumentsAndDelimiters(typeParameters: TypeParameter[], mapper: TypeMapper, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, symbolStack?: Symbol[] ) {
2586
+ function buildDisplayForTypeArgumentsAndDelimiters(typeParameters: TypeParameter[], mapper: TypeMapper, writer: SymbolWriter, enclosingDeclaration?: Node) {
2587
2587
if (typeParameters && typeParameters.length) {
2588
2588
writePunctuation(writer, SyntaxKind.LessThanToken);
2589
2589
let flags = TypeFormatFlags.InFirstTypeArgument;
@@ -4795,7 +4795,7 @@ namespace ts {
4795
4795
const typeParameters = classType ? classType.localTypeParameters :
4796
4796
declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) :
4797
4797
getTypeParametersFromJSDocTemplate(declaration);
4798
- const returnType = getSignatureReturnTypeFromDeclaration(declaration, minArgumentCount, isJSConstructSignature, classType);
4798
+ const returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType);
4799
4799
const typePredicate = declaration.type && declaration.type.kind === SyntaxKind.TypePredicate ?
4800
4800
createTypePredicateFromTypePredicateNode(declaration.type as TypePredicateNode) :
4801
4801
undefined;
@@ -4805,7 +4805,7 @@ namespace ts {
4805
4805
return links.resolvedSignature;
4806
4806
}
4807
4807
4808
- function getSignatureReturnTypeFromDeclaration(declaration: SignatureDeclaration, minArgumentCount: number, isJSConstructSignature: boolean, classType: Type) {
4808
+ function getSignatureReturnTypeFromDeclaration(declaration: SignatureDeclaration, isJSConstructSignature: boolean, classType: Type) {
4809
4809
if (isJSConstructSignature) {
4810
4810
return getTypeFromTypeNode(declaration.parameters[0].type);
4811
4811
}
@@ -5170,10 +5170,7 @@ namespace ts {
5170
5170
return undefined;
5171
5171
}
5172
5172
5173
- function resolveTypeReferenceName(
5174
- node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference,
5175
- typeReferenceName: EntityNameExpression | EntityName) {
5176
-
5173
+ function resolveTypeReferenceName(typeReferenceName: EntityNameExpression | EntityName) {
5177
5174
if (!typeReferenceName) {
5178
5175
return unknownSymbol;
5179
5176
}
@@ -5211,7 +5208,7 @@ namespace ts {
5211
5208
let type: Type;
5212
5209
if (node.kind === SyntaxKind.JSDocTypeReference) {
5213
5210
const typeReferenceName = getTypeReferenceName(node);
5214
- symbol = resolveTypeReferenceName(node, typeReferenceName);
5211
+ symbol = resolveTypeReferenceName(typeReferenceName);
5215
5212
type = getTypeReferenceType(node, symbol);
5216
5213
}
5217
5214
else {
@@ -6673,8 +6670,8 @@ namespace ts {
6673
6670
}
6674
6671
if (source.flags & TypeFlags.Union && target.flags & TypeFlags.Union ||
6675
6672
source.flags & TypeFlags.Intersection && target.flags & TypeFlags.Intersection) {
6676
- if (result = eachTypeRelatedToSomeType(<UnionOrIntersectionType>source, <UnionOrIntersectionType>target, /*reportErrors*/ false )) {
6677
- if (result &= eachTypeRelatedToSomeType(<UnionOrIntersectionType>target, <UnionOrIntersectionType>source, /*reportErrors*/ false )) {
6673
+ if (result = eachTypeRelatedToSomeType(<UnionOrIntersectionType>source, <UnionOrIntersectionType>target)) {
6674
+ if (result &= eachTypeRelatedToSomeType(<UnionOrIntersectionType>target, <UnionOrIntersectionType>source)) {
6678
6675
return result;
6679
6676
}
6680
6677
}
@@ -6735,7 +6732,7 @@ namespace ts {
6735
6732
return false;
6736
6733
}
6737
6734
6738
- function eachTypeRelatedToSomeType(source: UnionOrIntersectionType, target: UnionOrIntersectionType, reportErrors: boolean ): Ternary {
6735
+ function eachTypeRelatedToSomeType(source: UnionOrIntersectionType, target: UnionOrIntersectionType): Ternary {
6739
6736
let result = Ternary.True;
6740
6737
const sourceTypes = source.types;
6741
6738
for (const sourceType of sourceTypes) {
@@ -11772,7 +11769,7 @@ namespace ts {
11772
11769
// If the effective argument is 'undefined', then it is an argument that is present but is synthetic.
11773
11770
if (arg === undefined || arg.kind !== SyntaxKind.OmittedExpression) {
11774
11771
const paramType = getTypeAtPosition(signature, i);
11775
- let argType = getEffectiveArgumentType(node, i, arg );
11772
+ let argType = getEffectiveArgumentType(node, i);
11776
11773
11777
11774
// If the effective argument type is 'undefined', there is no synthetic type
11778
11775
// for the argument. In that case, we should check the argument.
@@ -11858,7 +11855,7 @@ namespace ts {
11858
11855
if (arg === undefined || arg.kind !== SyntaxKind.OmittedExpression) {
11859
11856
// Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter)
11860
11857
const paramType = getTypeAtPosition(signature, i);
11861
- let argType = getEffectiveArgumentType(node, i, arg );
11858
+ let argType = getEffectiveArgumentType(node, i);
11862
11859
11863
11860
// If the effective argument type is 'undefined', there is no synthetic type
11864
11861
// for the argument. In that case, we should check the argument.
@@ -12151,7 +12148,7 @@ namespace ts {
12151
12148
/**
12152
12149
* Gets the effective argument type for an argument in a call expression.
12153
12150
*/
12154
- function getEffectiveArgumentType(node: CallLikeExpression, argIndex: number, arg: Expression ): Type {
12151
+ function getEffectiveArgumentType(node: CallLikeExpression, argIndex: number): Type {
12155
12152
// Decorators provide special arguments, a tagged template expression provides
12156
12153
// a special first argument, and string literals get string literal types
12157
12154
// unless we're reporting errors
@@ -13556,15 +13553,15 @@ namespace ts {
13556
13553
return booleanType;
13557
13554
}
13558
13555
13559
- function checkObjectLiteralAssignment(node: ObjectLiteralExpression, sourceType: Type, contextualMapper?: TypeMapper ): Type {
13556
+ function checkObjectLiteralAssignment(node: ObjectLiteralExpression, sourceType: Type): Type {
13560
13557
const properties = node.properties;
13561
13558
for (const p of properties) {
13562
- checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, contextualMapper );
13559
+ checkObjectLiteralDestructuringPropertyAssignment(sourceType, p);
13563
13560
}
13564
13561
return sourceType;
13565
13562
}
13566
13563
13567
- function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType: Type, property: ObjectLiteralElementLike, contextualMapper?: TypeMapper ) {
13564
+ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType: Type, property: ObjectLiteralElementLike) {
13568
13565
if (property.kind === SyntaxKind.PropertyAssignment || property.kind === SyntaxKind.ShorthandPropertyAssignment) {
13569
13566
const name = <PropertyName>(<PropertyAssignment>property).name;
13570
13567
if (name.kind === SyntaxKind.ComputedPropertyName) {
@@ -13679,7 +13676,7 @@ namespace ts {
13679
13676
target = (<BinaryExpression>target).left;
13680
13677
}
13681
13678
if (target.kind === SyntaxKind.ObjectLiteralExpression) {
13682
- return checkObjectLiteralAssignment(<ObjectLiteralExpression>target, sourceType, contextualMapper );
13679
+ return checkObjectLiteralAssignment(<ObjectLiteralExpression>target, sourceType);
13683
13680
}
13684
13681
if (target.kind === SyntaxKind.ArrayLiteralExpression) {
13685
13682
return checkArrayLiteralAssignment(<ArrayLiteralExpression>target, sourceType, contextualMapper);
@@ -18588,7 +18585,7 @@ namespace ts {
18588
18585
// Since we already checked for ExportAssignment, this really could only be an Import
18589
18586
const importEqualsDeclaration = <ImportEqualsDeclaration>getAncestor(entityName, SyntaxKind.ImportEqualsDeclaration);
18590
18587
Debug.assert(importEqualsDeclaration !== undefined);
18591
- return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>entityName, importEqualsDeclaration, /*dontResolveAlias*/ true);
18588
+ return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>entityName, /*dontResolveAlias*/ true);
18592
18589
}
18593
18590
18594
18591
if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
@@ -19971,7 +19968,7 @@ namespace ts {
19971
19968
}
19972
19969
}
19973
19970
19974
- function checkGrammarTypeParameterList(node: FunctionLikeDeclaration, typeParameters: NodeArray<TypeParameterDeclaration>, file: SourceFile): boolean {
19971
+ function checkGrammarTypeParameterList(typeParameters: NodeArray<TypeParameterDeclaration>, file: SourceFile): boolean {
19975
19972
if (checkGrammarForDisallowedTrailingComma(typeParameters)) {
19976
19973
return true;
19977
19974
}
@@ -20022,7 +20019,7 @@ namespace ts {
20022
20019
function checkGrammarFunctionLikeDeclaration(node: FunctionLikeDeclaration): boolean {
20023
20020
// Prevent cascading error by short-circuit
20024
20021
const file = getSourceFileOfNode(node);
20025
- return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node .typeParameters, file) ||
20022
+ return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) ||
20026
20023
checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file);
20027
20024
}
20028
20025
@@ -20208,7 +20205,7 @@ namespace ts {
20208
20205
}
20209
20206
}
20210
20207
20211
- function checkGrammarForInvalidQuestionMark(node: Declaration, questionToken: Node, message: DiagnosticMessage): boolean {
20208
+ function checkGrammarForInvalidQuestionMark(questionToken: Node, message: DiagnosticMessage): boolean {
20212
20209
if (questionToken) {
20213
20210
return grammarErrorOnNode(questionToken, message);
20214
20211
}
@@ -20254,7 +20251,7 @@ namespace ts {
20254
20251
let currentKind: number;
20255
20252
if (prop.kind === SyntaxKind.PropertyAssignment || prop.kind === SyntaxKind.ShorthandPropertyAssignment) {
20256
20253
// Grammar checking for computedPropertyName and shorthandPropertyAssignment
20257
- checkGrammarForInvalidQuestionMark(prop, (<PropertyAssignment>prop).questionToken, Diagnostics.An_object_member_cannot_be_declared_optional);
20254
+ checkGrammarForInvalidQuestionMark((<PropertyAssignment>prop).questionToken, Diagnostics.An_object_member_cannot_be_declared_optional);
20258
20255
if (name.kind === SyntaxKind.NumericLiteral) {
20259
20256
checkGrammarNumericLiteral(<NumericLiteral>name);
20260
20257
}
@@ -20438,7 +20435,7 @@ namespace ts {
20438
20435
}
20439
20436
20440
20437
if (node.parent.kind === SyntaxKind.ObjectLiteralExpression) {
20441
- if (checkGrammarForInvalidQuestionMark(node, node .questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) {
20438
+ if (checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) {
20442
20439
return true;
20443
20440
}
20444
20441
else if (node.body === undefined) {
0 commit comments