Skip to content

Commit 3fd0239

Browse files
committed
Rename SyntaxKind.Parameter to SyntaxKind.ParameterDeclaration
1 parent 3f1277c commit 3fd0239

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

+134
-134
lines changed

src/compiler/binder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
724724
break;
725725
case SyntaxKind.JSDocFunctionType:
726726
return (isJSDocConstructSignature(node) ? InternalSymbolName.New : InternalSymbolName.Call);
727-
case SyntaxKind.Parameter:
727+
case SyntaxKind.ParameterDeclaration:
728728
// Parameters with names are handled at the top of this function. Parameters
729729
// without names can only come from JSDocFunctionTypes.
730730
Debug.assert(node.parent.kind === SyntaxKind.JSDocFunctionType, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`);
@@ -1193,7 +1193,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
11931193
case SyntaxKind.BindingElement:
11941194
bindBindingElementFlow(node as BindingElement);
11951195
break;
1196-
case SyntaxKind.Parameter:
1196+
case SyntaxKind.ParameterDeclaration:
11971197
bindParameterFlow(node as ParameterDeclaration);
11981198
break;
11991199
case SyntaxKind.ObjectLiteralExpression:
@@ -2859,7 +2859,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
28592859
break; // Binding the children will handle everything
28602860
case SyntaxKind.TypeParameter:
28612861
return bindTypeParameter(node as TypeParameterDeclaration);
2862-
case SyntaxKind.Parameter:
2862+
case SyntaxKind.ParameterDeclaration:
28632863
return bindParameter(node as ParameterDeclaration);
28642864
case SyntaxKind.VariableDeclaration:
28652865
return bindVariableDeclarationOrBindingElement(node as VariableDeclaration);

src/compiler/checker.ts

Lines changed: 37 additions & 37 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
@@ -1529,7 +1529,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
15291529
// Signature elements
15301530
case SyntaxKind.TypeParameter:
15311531
return emitTypeParameter(node as TypeParameterDeclaration);
1532-
case SyntaxKind.Parameter:
1532+
case SyntaxKind.ParameterDeclaration:
15331533
return emitParameter(node as ParameterDeclaration);
15341534
case SyntaxKind.Decorator:
15351535
return emitDecorator(node as Decorator);
@@ -5253,7 +5253,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
52535253
forEach((node as VariableDeclarationList).declarations, generateNames);
52545254
break;
52555255
case SyntaxKind.VariableDeclaration:
5256-
case SyntaxKind.Parameter:
5256+
case SyntaxKind.ParameterDeclaration:
52575257
case SyntaxKind.BindingElement:
52585258
case SyntaxKind.ClassDeclaration:
52595259
generateNameIfNeeded((node as NamedDeclaration).name);

src/compiler/factory/nodeFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
16431643
type?: TypeNode,
16441644
initializer?: Expression,
16451645
) {
1646-
const node = createBaseDeclaration<ParameterDeclaration>(SyntaxKind.Parameter);
1646+
const node = createBaseDeclaration<ParameterDeclaration>(SyntaxKind.ParameterDeclaration);
16471647
node.modifiers = asNodeArray(modifiers);
16481648
node.dotDotDotToken = dotDotDotToken;
16491649
node.name = asName(name);
@@ -7283,7 +7283,7 @@ export function getTransformFlagsSubtreeExclusions(kind: SyntaxKind) {
72837283
return TransformFlags.ArrayLiteralOrCallOrNewExcludes;
72847284
case SyntaxKind.ModuleDeclaration:
72857285
return TransformFlags.ModuleExcludes;
7286-
case SyntaxKind.Parameter:
7286+
case SyntaxKind.ParameterDeclaration:
72877287
return TransformFlags.ParameterExcludes;
72887288
case SyntaxKind.ArrowFunction:
72897289
return TransformFlags.ArrowFunctionExcludes;

src/compiler/factory/nodeTests.ts

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

405405
export function isParameterDeclaration(node: Node): node is ParameterDeclaration {
406-
return node.kind === SyntaxKind.Parameter;
406+
return node.kind === SyntaxKind.ParameterDeclaration;
407407
}
408408

409409
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
@@ -519,7 +519,7 @@ const forEachChildTable: ForEachChildTable = {
519519
[SyntaxKind.SpreadAssignment]: function forEachChildInSpreadAssignment<T>(node: SpreadAssignment, cbNode: (node: Node) => T | undefined, _cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
520520
return visitNode(cbNode, node.expression);
521521
},
522-
[SyntaxKind.Parameter]: function forEachChildInParameter<T>(node: ParameterDeclaration, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
522+
[SyntaxKind.ParameterDeclaration]: function forEachChildInParameter<T>(node: ParameterDeclaration, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
523523
return visitNodes(cbNode, cbNodes, node.modifiers) ||
524524
visitNode(cbNode, node.dotDotDotToken) ||
525525
visitNode(cbNode, node.name) ||
@@ -3364,7 +3364,7 @@ namespace Parser {
33643364
}
33653365

33663366
function isReusableParameter(node: Node) {
3367-
if (node.kind !== SyntaxKind.Parameter) {
3367+
if (node.kind !== SyntaxKind.ParameterDeclaration) {
33683368
return false;
33693369
}
33703370

src/compiler/program.ts

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

29852985
switch (parent.kind) {
2986-
case SyntaxKind.Parameter:
2986+
case SyntaxKind.ParameterDeclaration:
29872987
case SyntaxKind.PropertyDeclaration:
29882988
case SyntaxKind.MethodDeclaration:
29892989
if ((parent as ParameterDeclaration | PropertyDeclaration | MethodDeclaration).questionToken === node) {
@@ -3157,7 +3157,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
31573157
return "skip";
31583158
}
31593159
break;
3160-
case SyntaxKind.Parameter:
3160+
case SyntaxKind.ParameterDeclaration:
31613161
// Check modifiers of parameter declaration
31623162
if (nodes === (parent as ParameterDeclaration).modifiers && some(nodes, isModifier)) {
31633163
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)