@@ -1054,7 +1054,7 @@ namespace ts {
10541054 if (node.moduleReference.kind === SyntaxKind.ExternalModuleReference) {
10551055 return resolveExternalModuleSymbol(resolveExternalModuleName(node, getExternalModuleImportEqualsDeclarationExpression(node)));
10561056 }
1057- return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>node.moduleReference, node );
1057+ return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>node.moduleReference);
10581058 }
10591059
10601060 function getTargetOfImportClause(node: ImportClause): Symbol {
@@ -1267,7 +1267,7 @@ namespace ts {
12671267 }
12681268
12691269 // 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 {
12711271 // There are three things we might try to look for. In the following examples,
12721272 // the search term is enclosed in |...|:
12731273 //
@@ -2583,7 +2583,7 @@ namespace ts {
25832583 }
25842584 }
25852585
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) {
25872587 if (typeParameters && typeParameters.length) {
25882588 writePunctuation(writer, SyntaxKind.LessThanToken);
25892589 let flags = TypeFormatFlags.InFirstTypeArgument;
@@ -4795,7 +4795,7 @@ namespace ts {
47954795 const typeParameters = classType ? classType.localTypeParameters :
47964796 declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) :
47974797 getTypeParametersFromJSDocTemplate(declaration);
4798- const returnType = getSignatureReturnTypeFromDeclaration(declaration, minArgumentCount, isJSConstructSignature, classType);
4798+ const returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType);
47994799 const typePredicate = declaration.type && declaration.type.kind === SyntaxKind.TypePredicate ?
48004800 createTypePredicateFromTypePredicateNode(declaration.type as TypePredicateNode) :
48014801 undefined;
@@ -4805,7 +4805,7 @@ namespace ts {
48054805 return links.resolvedSignature;
48064806 }
48074807
4808- function getSignatureReturnTypeFromDeclaration(declaration: SignatureDeclaration, minArgumentCount: number, isJSConstructSignature: boolean, classType: Type) {
4808+ function getSignatureReturnTypeFromDeclaration(declaration: SignatureDeclaration, isJSConstructSignature: boolean, classType: Type) {
48094809 if (isJSConstructSignature) {
48104810 return getTypeFromTypeNode(declaration.parameters[0].type);
48114811 }
@@ -5170,10 +5170,7 @@ namespace ts {
51705170 return undefined;
51715171 }
51725172
5173- function resolveTypeReferenceName(
5174- node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference,
5175- typeReferenceName: EntityNameExpression | EntityName) {
5176-
5173+ function resolveTypeReferenceName(typeReferenceName: EntityNameExpression | EntityName) {
51775174 if (!typeReferenceName) {
51785175 return unknownSymbol;
51795176 }
@@ -5211,7 +5208,7 @@ namespace ts {
52115208 let type: Type;
52125209 if (node.kind === SyntaxKind.JSDocTypeReference) {
52135210 const typeReferenceName = getTypeReferenceName(node);
5214- symbol = resolveTypeReferenceName(node, typeReferenceName);
5211+ symbol = resolveTypeReferenceName(typeReferenceName);
52155212 type = getTypeReferenceType(node, symbol);
52165213 }
52175214 else {
@@ -6673,8 +6670,8 @@ namespace ts {
66736670 }
66746671 if (source.flags & TypeFlags.Union && target.flags & TypeFlags.Union ||
66756672 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)) {
66786675 return result;
66796676 }
66806677 }
@@ -6735,7 +6732,7 @@ namespace ts {
67356732 return false;
67366733 }
67376734
6738- function eachTypeRelatedToSomeType(source: UnionOrIntersectionType, target: UnionOrIntersectionType, reportErrors: boolean ): Ternary {
6735+ function eachTypeRelatedToSomeType(source: UnionOrIntersectionType, target: UnionOrIntersectionType): Ternary {
67396736 let result = Ternary.True;
67406737 const sourceTypes = source.types;
67416738 for (const sourceType of sourceTypes) {
@@ -11772,7 +11769,7 @@ namespace ts {
1177211769 // If the effective argument is 'undefined', then it is an argument that is present but is synthetic.
1177311770 if (arg === undefined || arg.kind !== SyntaxKind.OmittedExpression) {
1177411771 const paramType = getTypeAtPosition(signature, i);
11775- let argType = getEffectiveArgumentType(node, i, arg );
11772+ let argType = getEffectiveArgumentType(node, i);
1177611773
1177711774 // If the effective argument type is 'undefined', there is no synthetic type
1177811775 // for the argument. In that case, we should check the argument.
@@ -11858,7 +11855,7 @@ namespace ts {
1185811855 if (arg === undefined || arg.kind !== SyntaxKind.OmittedExpression) {
1185911856 // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter)
1186011857 const paramType = getTypeAtPosition(signature, i);
11861- let argType = getEffectiveArgumentType(node, i, arg );
11858+ let argType = getEffectiveArgumentType(node, i);
1186211859
1186311860 // If the effective argument type is 'undefined', there is no synthetic type
1186411861 // for the argument. In that case, we should check the argument.
@@ -12151,7 +12148,7 @@ namespace ts {
1215112148 /**
1215212149 * Gets the effective argument type for an argument in a call expression.
1215312150 */
12154- function getEffectiveArgumentType(node: CallLikeExpression, argIndex: number, arg: Expression ): Type {
12151+ function getEffectiveArgumentType(node: CallLikeExpression, argIndex: number): Type {
1215512152 // Decorators provide special arguments, a tagged template expression provides
1215612153 // a special first argument, and string literals get string literal types
1215712154 // unless we're reporting errors
@@ -13556,15 +13553,15 @@ namespace ts {
1355613553 return booleanType;
1355713554 }
1355813555
13559- function checkObjectLiteralAssignment(node: ObjectLiteralExpression, sourceType: Type, contextualMapper?: TypeMapper ): Type {
13556+ function checkObjectLiteralAssignment(node: ObjectLiteralExpression, sourceType: Type): Type {
1356013557 const properties = node.properties;
1356113558 for (const p of properties) {
13562- checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, contextualMapper );
13559+ checkObjectLiteralDestructuringPropertyAssignment(sourceType, p);
1356313560 }
1356413561 return sourceType;
1356513562 }
1356613563
13567- function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType: Type, property: ObjectLiteralElementLike, contextualMapper?: TypeMapper ) {
13564+ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType: Type, property: ObjectLiteralElementLike) {
1356813565 if (property.kind === SyntaxKind.PropertyAssignment || property.kind === SyntaxKind.ShorthandPropertyAssignment) {
1356913566 const name = <PropertyName>(<PropertyAssignment>property).name;
1357013567 if (name.kind === SyntaxKind.ComputedPropertyName) {
@@ -13679,7 +13676,7 @@ namespace ts {
1367913676 target = (<BinaryExpression>target).left;
1368013677 }
1368113678 if (target.kind === SyntaxKind.ObjectLiteralExpression) {
13682- return checkObjectLiteralAssignment(<ObjectLiteralExpression>target, sourceType, contextualMapper );
13679+ return checkObjectLiteralAssignment(<ObjectLiteralExpression>target, sourceType);
1368313680 }
1368413681 if (target.kind === SyntaxKind.ArrayLiteralExpression) {
1368513682 return checkArrayLiteralAssignment(<ArrayLiteralExpression>target, sourceType, contextualMapper);
@@ -18588,7 +18585,7 @@ namespace ts {
1858818585 // Since we already checked for ExportAssignment, this really could only be an Import
1858918586 const importEqualsDeclaration = <ImportEqualsDeclaration>getAncestor(entityName, SyntaxKind.ImportEqualsDeclaration);
1859018587 Debug.assert(importEqualsDeclaration !== undefined);
18591- return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>entityName, importEqualsDeclaration, /*dontResolveAlias*/ true);
18588+ return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>entityName, /*dontResolveAlias*/ true);
1859218589 }
1859318590
1859418591 if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {
@@ -19971,7 +19968,7 @@ namespace ts {
1997119968 }
1997219969 }
1997319970
19974- function checkGrammarTypeParameterList(node: FunctionLikeDeclaration, typeParameters: NodeArray<TypeParameterDeclaration>, file: SourceFile): boolean {
19971+ function checkGrammarTypeParameterList(typeParameters: NodeArray<TypeParameterDeclaration>, file: SourceFile): boolean {
1997519972 if (checkGrammarForDisallowedTrailingComma(typeParameters)) {
1997619973 return true;
1997719974 }
@@ -20022,7 +20019,7 @@ namespace ts {
2002220019 function checkGrammarFunctionLikeDeclaration(node: FunctionLikeDeclaration): boolean {
2002320020 // Prevent cascading error by short-circuit
2002420021 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) ||
2002620023 checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file);
2002720024 }
2002820025
@@ -20208,7 +20205,7 @@ namespace ts {
2020820205 }
2020920206 }
2021020207
20211- function checkGrammarForInvalidQuestionMark(node: Declaration, questionToken: Node, message: DiagnosticMessage): boolean {
20208+ function checkGrammarForInvalidQuestionMark(questionToken: Node, message: DiagnosticMessage): boolean {
2021220209 if (questionToken) {
2021320210 return grammarErrorOnNode(questionToken, message);
2021420211 }
@@ -20254,7 +20251,7 @@ namespace ts {
2025420251 let currentKind: number;
2025520252 if (prop.kind === SyntaxKind.PropertyAssignment || prop.kind === SyntaxKind.ShorthandPropertyAssignment) {
2025620253 // 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);
2025820255 if (name.kind === SyntaxKind.NumericLiteral) {
2025920256 checkGrammarNumericLiteral(<NumericLiteral>name);
2026020257 }
@@ -20438,7 +20435,7 @@ namespace ts {
2043820435 }
2043920436
2044020437 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)) {
2044220439 return true;
2044320440 }
2044420441 else if (node.body === undefined) {
0 commit comments