Skip to content

Commit 8f21236

Browse files
committed
Rename SyntaxKind.Parameter to SyntaxKind.ParameterDeclaration
1 parent f957602 commit 8f21236

Some content is hidden

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

53 files changed

+136
-136
lines changed

src/compiler/binder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
734734
break;
735735
case SyntaxKind.JSDocFunctionType:
736736
return (isJSDocConstructSignature(node) ? InternalSymbolName.New : InternalSymbolName.Call);
737-
case SyntaxKind.Parameter:
737+
case SyntaxKind.ParameterDeclaration:
738738
// Parameters with names are handled at the top of this function. Parameters
739739
// without names can only come from JSDocFunctionTypes.
740740
Debug.assert(node.parent.kind === SyntaxKind.JSDocFunctionType, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
@@ -1206,7 +1206,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
12061206
case SyntaxKind.BindingElement:
12071207
bindBindingElementFlow(node as BindingElement);
12081208
break;
1209-
case SyntaxKind.Parameter:
1209+
case SyntaxKind.ParameterDeclaration:
12101210
bindParameterFlow(node as ParameterDeclaration);
12111211
break;
12121212
case SyntaxKind.ObjectLiteralExpression:
@@ -2937,7 +2937,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
29372937
break; // Binding the children will handle everything
29382938
case SyntaxKind.TypeParameter:
29392939
return bindTypeParameter(node as TypeParameterDeclaration);
2940-
case SyntaxKind.Parameter:
2940+
case SyntaxKind.ParameterDeclaration:
29412941
return bindParameter(node as ParameterDeclaration);
29422942
case SyntaxKind.VariableDeclaration:
29432943
return bindVariableDeclarationOrBindingElement(node as VariableDeclaration);

src/compiler/checker.ts

Lines changed: 34 additions & 34 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
@@ -1528,7 +1528,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
15281528
// Signature elements
15291529
case SyntaxKind.TypeParameter:
15301530
return emitTypeParameter(node as TypeParameterDeclaration);
1531-
case SyntaxKind.Parameter:
1531+
case SyntaxKind.ParameterDeclaration:
15321532
return emitParameter(node as ParameterDeclaration);
15331533
case SyntaxKind.Decorator:
15341534
return emitDecorator(node as Decorator);
@@ -5273,7 +5273,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
52735273
forEach((node as VariableDeclarationList).declarations, generateNames);
52745274
break;
52755275
case SyntaxKind.VariableDeclaration:
5276-
case SyntaxKind.Parameter:
5276+
case SyntaxKind.ParameterDeclaration:
52775277
case SyntaxKind.BindingElement:
52785278
case SyntaxKind.ClassDeclaration:
52795279
generateNameIfNeeded((node as NamedDeclaration).name);

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);
@@ -7309,7 +7309,7 @@ export function getTransformFlagsSubtreeExclusions(kind: SyntaxKind) {
73097309
return TransformFlags.ArrayLiteralOrCallOrNewExcludes;
73107310
case SyntaxKind.ModuleDeclaration:
73117311
return TransformFlags.ModuleExcludes;
7312-
case SyntaxKind.Parameter:
7312+
case SyntaxKind.ParameterDeclaration:
73137313
return TransformFlags.ParameterExcludes;
73147314
case SyntaxKind.ArrowFunction:
73157315
return TransformFlags.ArrowFunctionExcludes;

src/compiler/factory/nodeTests.ts

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

406406
export function isParameterDeclaration(node: Node): node is ParameterDeclaration {
407-
return node.kind === SyntaxKind.Parameter;
407+
return node.kind === SyntaxKind.ParameterDeclaration;
408408
}
409409

410410
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
@@ -998,7 +998,7 @@ export function getTargetOfBindingOrAssignmentElement(bindingElement: BindingOrA
998998
*/
999999
export function getRestIndicatorOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): BindingOrAssignmentElementRestIndicator | undefined {
10001000
switch (bindingElement.kind) {
1001-
case SyntaxKind.Parameter:
1001+
case SyntaxKind.ParameterDeclaration:
10021002
case SyntaxKind.BindingElement:
10031003
// `...` in `let [...a] = ...`
10041004
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
@@ -520,7 +520,7 @@ const forEachChildTable: ForEachChildTable = {
520520
[SyntaxKind.SpreadAssignment]: function forEachChildInSpreadAssignment<T>(node: SpreadAssignment, cbNode: (node: Node) => T | undefined, _cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
521521
return visitNode(cbNode, node.expression);
522522
},
523-
[SyntaxKind.Parameter]: function forEachChildInParameter<T>(node: ParameterDeclaration, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
523+
[SyntaxKind.ParameterDeclaration]: function forEachChildInParameter<T>(node: ParameterDeclaration, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
524524
return visitNodes(cbNode, cbNodes, node.modifiers) ||
525525
visitNode(cbNode, node.dotDotDotToken) ||
526526
visitNode(cbNode, node.name) ||
@@ -3374,7 +3374,7 @@ namespace Parser {
33743374
}
33753375

33763376
function isReusableParameter(node: Node) {
3377-
if (node.kind !== SyntaxKind.Parameter) {
3377+
if (node.kind !== SyntaxKind.ParameterDeclaration) {
33783378
return false;
33793379
}
33803380

src/compiler/program.ts

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

30393039
switch (parent.kind) {
3040-
case SyntaxKind.Parameter:
3040+
case SyntaxKind.ParameterDeclaration:
30413041
case SyntaxKind.PropertyDeclaration:
30423042
case SyntaxKind.MethodDeclaration:
30433043
if ((parent as ParameterDeclaration | PropertyDeclaration | MethodDeclaration).questionToken === node) {
@@ -3211,7 +3211,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
32113211
return "skip";
32123212
}
32133213
break;
3214-
case SyntaxKind.Parameter:
3214+
case SyntaxKind.ParameterDeclaration:
32153215
// Check modifiers of parameter declaration
32163216
if (nodes === (parent as ParameterDeclaration).modifiers && some(nodes, isModifier)) {
32173217
diagnostics.push(createDiagnosticForNodeArray(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files));

src/compiler/transformers/classFields.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ export function transformClassFields(context: TransformationContext): (x: Source
479479
return visitVariableStatement(node as VariableStatement);
480480
case SyntaxKind.VariableDeclaration:
481481
return visitVariableDeclaration(node as VariableDeclaration);
482-
case SyntaxKind.Parameter:
482+
case SyntaxKind.ParameterDeclaration:
483483
return visitParameterDeclaration(node as ParameterDeclaration);
484484
case SyntaxKind.BindingElement:
485485
return visitBindingElement(node as BindingElement);

0 commit comments

Comments
 (0)