Skip to content

Commit 5b8ea75

Browse files
committed
Rename SyntaxKind.Parameter to SyntaxKind.ParameterDeclaration
1 parent f4cfe6e commit 5b8ea75

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
@@ -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:
@@ -2940,7 +2940,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
29402940
break; // Binding the children will handle everything
29412941
case SyntaxKind.TypeParameter:
29422942
return bindTypeParameter(node as TypeParameterDeclaration);
2943-
case SyntaxKind.Parameter:
2943+
case SyntaxKind.ParameterDeclaration:
29442944
return bindParameter(node as ParameterDeclaration);
29452945
case SyntaxKind.VariableDeclaration:
29462946
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
@@ -1577,7 +1577,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
15771577
// Signature elements
15781578
case SyntaxKind.TypeParameter:
15791579
return emitTypeParameter(node as TypeParameterDeclaration);
1580-
case SyntaxKind.Parameter:
1580+
case SyntaxKind.ParameterDeclaration:
15811581
return emitParameter(node as ParameterDeclaration);
15821582
case SyntaxKind.Decorator:
15831583
return emitDecorator(node as Decorator);
@@ -5298,7 +5298,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
52985298
forEach((node as VariableDeclarationList).declarations, generateNames);
52995299
break;
53005300
case SyntaxKind.VariableDeclaration:
5301-
case SyntaxKind.Parameter:
5301+
case SyntaxKind.ParameterDeclaration:
53025302
case SyntaxKind.BindingElement:
53035303
case SyntaxKind.ClassDeclaration:
53045304
generateNameIfNeeded((node as NamedDeclaration).name);

src/compiler/expressionToTypeNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function createSyntacticTypeNodeBuilder(
8989
switch (node.kind) {
9090
case SyntaxKind.PropertySignature:
9191
return serializeExistingTypeAnnotation(getEffectiveTypeAnnotationNode(node));
92-
case SyntaxKind.Parameter:
92+
case SyntaxKind.ParameterDeclaration:
9393
return typeFromParameter(node, context);
9494
case SyntaxKind.VariableDeclaration:
9595
return typeFromVariable(node, context);

src/compiler/factory/nodeFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
16491649
type?: TypeNode,
16501650
initializer?: Expression,
16511651
) {
1652-
const node = createBaseDeclaration<ParameterDeclaration>(SyntaxKind.Parameter);
1652+
const node = createBaseDeclaration<ParameterDeclaration>(SyntaxKind.ParameterDeclaration);
16531653
node.modifiers = asNodeArray(modifiers);
16541654
node.dotDotDotToken = dotDotDotToken;
16551655
node.name = asName(name);
@@ -7321,7 +7321,7 @@ function getTransformFlagsSubtreeExclusions(kind: SyntaxKind) {
73217321
return TransformFlags.ArrayLiteralOrCallOrNewExcludes;
73227322
case SyntaxKind.ModuleDeclaration:
73237323
return TransformFlags.ModuleExcludes;
7324-
case SyntaxKind.Parameter:
7324+
case SyntaxKind.ParameterDeclaration:
73257325
return TransformFlags.ParameterExcludes;
73267326
case SyntaxKind.ArrowFunction:
73277327
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
@@ -984,7 +984,7 @@ export function getTargetOfBindingOrAssignmentElement(bindingElement: BindingOrA
984984
*/
985985
export function getRestIndicatorOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): BindingOrAssignmentElementRestIndicator | undefined {
986986
switch (bindingElement.kind) {
987-
case SyntaxKind.Parameter:
987+
case SyntaxKind.ParameterDeclaration:
988988
case SyntaxKind.BindingElement:
989989
// `...` in `let [...a] = ...`
990990
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) ||
@@ -3389,7 +3389,7 @@ namespace Parser {
33893389
}
33903390

33913391
function isReusableParameter(node: Node) {
3392-
if (node.kind !== SyntaxKind.Parameter) {
3392+
if (node.kind !== SyntaxKind.ParameterDeclaration) {
33933393
return false;
33943394
}
33953395

src/compiler/program.ts

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

31493149
switch (parent.kind) {
3150-
case SyntaxKind.Parameter:
3150+
case SyntaxKind.ParameterDeclaration:
31513151
case SyntaxKind.PropertyDeclaration:
31523152
case SyntaxKind.MethodDeclaration:
31533153
if ((parent as ParameterDeclaration | PropertyDeclaration | MethodDeclaration).questionToken === node) {
@@ -3321,7 +3321,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
33213321
return "skip";
33223322
}
33233323
break;
3324-
case SyntaxKind.Parameter:
3324+
case SyntaxKind.ParameterDeclaration:
33253325
// Check modifiers of parameter declaration
33263326
if (nodes === (parent as ParameterDeclaration).modifiers && some(nodes, isModifier)) {
33273327
diagnostics.push(createDiagnosticForNodeArray(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files));

0 commit comments

Comments
 (0)