Skip to content

Commit f11ab3e

Browse files
committed
Rename SyntaxKind.Parameter to SyntaxKind.ParameterDeclaration
1 parent f975149 commit f11ab3e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+144
-144
lines changed

src/compiler/binder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
735735
break;
736736
case SyntaxKind.JSDocFunctionType:
737737
return (isJSDocConstructSignature(node) ? InternalSymbolName.New : InternalSymbolName.Call);
738-
case SyntaxKind.Parameter:
738+
case SyntaxKind.ParameterDeclaration:
739739
// Parameters with names are handled at the top of this function. Parameters
740740
// without names can only come from JSDocFunctionTypes.
741741
Debug.assert(node.parent.kind === SyntaxKind.JSDocFunctionType, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
@@ -1207,7 +1207,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
12071207
case SyntaxKind.BindingElement:
12081208
bindBindingElementFlow(node as BindingElement);
12091209
break;
1210-
case SyntaxKind.Parameter:
1210+
case SyntaxKind.ParameterDeclaration:
12111211
bindParameterFlow(node as ParameterDeclaration);
12121212
break;
12131213
case SyntaxKind.ObjectLiteralExpression:
@@ -2941,7 +2941,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
29412941
break; // Binding the children will handle everything
29422942
case SyntaxKind.TypeParameter:
29432943
return bindTypeParameter(node as TypeParameterDeclaration);
2944-
case SyntaxKind.Parameter:
2944+
case SyntaxKind.ParameterDeclaration:
29452945
return bindParameter(node as ParameterDeclaration);
29462946
case SyntaxKind.VariableDeclaration:
29472947
return bindVariableDeclarationOrBindingElement(node as VariableDeclaration);

src/compiler/checker.ts

Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.

src/compiler/emitter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
15721572
// Signature elements
15731573
case SyntaxKind.TypeParameter:
15741574
return emitTypeParameter(node as TypeParameterDeclaration);
1575-
case SyntaxKind.Parameter:
1575+
case SyntaxKind.ParameterDeclaration:
15761576
return emitParameter(node as ParameterDeclaration);
15771577
case SyntaxKind.Decorator:
15781578
return emitDecorator(node as Decorator);
@@ -5292,7 +5292,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
52925292
forEach((node as VariableDeclarationList).declarations, generateNames);
52935293
break;
52945294
case SyntaxKind.VariableDeclaration:
5295-
case SyntaxKind.Parameter:
5295+
case SyntaxKind.ParameterDeclaration:
52965296
case SyntaxKind.BindingElement:
52975297
case SyntaxKind.ClassDeclaration:
52985298
generateNameIfNeeded((node as NamedDeclaration).name);

src/compiler/expressionToTypeNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function createSyntacticTypeNodeBuilder(options: CompilerOptions, resolve
8585
switch (node.kind) {
8686
case SyntaxKind.PropertySignature:
8787
return serializeExistingTypeAnnotation(getEffectiveTypeAnnotationNode(node));
88-
case SyntaxKind.Parameter:
88+
case SyntaxKind.ParameterDeclaration:
8989
return typeFromParameter(node, context);
9090
case SyntaxKind.VariableDeclaration:
9191
return typeFromVariable(node, context);

src/compiler/factory/nodeFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
16471647
type?: TypeNode,
16481648
initializer?: Expression,
16491649
) {
1650-
const node = createBaseDeclaration<ParameterDeclaration>(SyntaxKind.Parameter);
1650+
const node = createBaseDeclaration<ParameterDeclaration>(SyntaxKind.ParameterDeclaration);
16511651
node.modifiers = asNodeArray(modifiers);
16521652
node.dotDotDotToken = dotDotDotToken;
16531653
node.name = asName(name);
@@ -7314,7 +7314,7 @@ function getTransformFlagsSubtreeExclusions(kind: SyntaxKind) {
73147314
return TransformFlags.ArrayLiteralOrCallOrNewExcludes;
73157315
case SyntaxKind.ModuleDeclaration:
73167316
return TransformFlags.ModuleExcludes;
7317-
case SyntaxKind.Parameter:
7317+
case SyntaxKind.ParameterDeclaration:
73187318
return TransformFlags.ParameterExcludes;
73197319
case SyntaxKind.ArrowFunction:
73207320
return TransformFlags.ArrowFunctionExcludes;

src/compiler/factory/nodeTests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ export function isTypeParameterDeclaration(node: Node): node is TypeParameterDec
405405
}
406406

407407
export function isParameterDeclaration(node: Node): node is ParameterDeclaration {
408-
return node.kind === SyntaxKind.Parameter;
408+
return node.kind === SyntaxKind.ParameterDeclaration;
409409
}
410410

411411
export function isDecorator(node: Node): node is Decorator {

src/compiler/factory/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ export function getTargetOfBindingOrAssignmentElement(bindingElement: BindingOrA
976976
*/
977977
export function getRestIndicatorOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): BindingOrAssignmentElementRestIndicator | undefined {
978978
switch (bindingElement.kind) {
979-
case SyntaxKind.Parameter:
979+
case SyntaxKind.ParameterDeclaration:
980980
case SyntaxKind.BindingElement:
981981
// `...` in `let [...a] = ...`
982982
return bindingElement.dotDotDotToken;

src/compiler/factory/utilitiesPublic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function setTextRange<T extends TextRange>(range: T, location: TextRange
1414
export function canHaveModifiers(node: Node): node is HasModifiers {
1515
const kind = node.kind;
1616
return kind === SyntaxKind.TypeParameter
17-
|| kind === SyntaxKind.Parameter
17+
|| kind === SyntaxKind.ParameterDeclaration
1818
|| kind === SyntaxKind.PropertySignature
1919
|| kind === SyntaxKind.PropertyDeclaration
2020
|| kind === SyntaxKind.MethodSignature
@@ -42,7 +42,7 @@ export function canHaveModifiers(node: Node): node is HasModifiers {
4242

4343
export function canHaveDecorators(node: Node): node is HasDecorators {
4444
const kind = node.kind;
45-
return kind === SyntaxKind.Parameter
45+
return kind === SyntaxKind.ParameterDeclaration
4646
|| kind === SyntaxKind.PropertyDeclaration
4747
|| kind === SyntaxKind.MethodDeclaration
4848
|| kind === SyntaxKind.GetAccessor

src/compiler/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ const forEachChildTable: ForEachChildTable = {
524524
[SyntaxKind.SpreadAssignment]: function forEachChildInSpreadAssignment<T>(node: SpreadAssignment, cbNode: (node: Node) => T | undefined, _cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
525525
return visitNode(cbNode, node.expression);
526526
},
527-
[SyntaxKind.Parameter]: function forEachChildInParameter<T>(node: ParameterDeclaration, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
527+
[SyntaxKind.ParameterDeclaration]: function forEachChildInParameter<T>(node: ParameterDeclaration, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
528528
return visitNodes(cbNode, cbNodes, node.modifiers) ||
529529
visitNode(cbNode, node.dotDotDotToken) ||
530530
visitNode(cbNode, node.name) ||
@@ -3380,7 +3380,7 @@ namespace Parser {
33803380
}
33813381

33823382
function isReusableParameter(node: Node) {
3383-
if (node.kind !== SyntaxKind.Parameter) {
3383+
if (node.kind !== SyntaxKind.ParameterDeclaration) {
33843384
return false;
33853385
}
33863386

src/compiler/program.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3132,7 +3132,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
31323132
// Otherwise break to visit each child
31333133

31343134
switch (parent.kind) {
3135-
case SyntaxKind.Parameter:
3135+
case SyntaxKind.ParameterDeclaration:
31363136
case SyntaxKind.PropertyDeclaration:
31373137
case SyntaxKind.MethodDeclaration:
31383138
if ((parent as ParameterDeclaration | PropertyDeclaration | MethodDeclaration).questionToken === node) {
@@ -3306,7 +3306,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
33063306
return "skip";
33073307
}
33083308
break;
3309-
case SyntaxKind.Parameter:
3309+
case SyntaxKind.ParameterDeclaration:
33103310
// Check modifiers of parameter declaration
33113311
if (nodes === (parent as ParameterDeclaration).modifiers && some(nodes, isModifier)) {
33123312
diagnostics.push(createDiagnosticForNodeArray(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files));

0 commit comments

Comments
 (0)