Skip to content

Commit 4745df8

Browse files
committed
Rename SyntaxKind.Parameter to SyntaxKind.ParameterDeclaration
1 parent a7e806d commit 4745df8

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

+145
-145
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:
@@ -2938,7 +2938,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
29382938
break; // Binding the children will handle everything
29392939
case SyntaxKind.TypeParameter:
29402940
return bindTypeParameter(node as TypeParameterDeclaration);
2941-
case SyntaxKind.Parameter:
2941+
case SyntaxKind.ParameterDeclaration:
29422942
return bindParameter(node as ParameterDeclaration);
29432943
case SyntaxKind.VariableDeclaration:
29442944
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
@@ -1568,7 +1568,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
15681568
// Signature elements
15691569
case SyntaxKind.TypeParameter:
15701570
return emitTypeParameter(node as TypeParameterDeclaration);
1571-
case SyntaxKind.Parameter:
1571+
case SyntaxKind.ParameterDeclaration:
15721572
return emitParameter(node as ParameterDeclaration);
15731573
case SyntaxKind.Decorator:
15741574
return emitDecorator(node as Decorator);
@@ -5288,7 +5288,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
52885288
forEach((node as VariableDeclarationList).declarations, generateNames);
52895289
break;
52905290
case SyntaxKind.VariableDeclaration:
5291-
case SyntaxKind.Parameter:
5291+
case SyntaxKind.ParameterDeclaration:
52925292
case SyntaxKind.BindingElement:
52935293
case SyntaxKind.ClassDeclaration:
52945294
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
@@ -1648,7 +1648,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode
16481648
type?: TypeNode,
16491649
initializer?: Expression,
16501650
) {
1651-
const node = createBaseDeclaration<ParameterDeclaration>(SyntaxKind.Parameter);
1651+
const node = createBaseDeclaration<ParameterDeclaration>(SyntaxKind.ParameterDeclaration);
16521652
node.modifiers = asNodeArray(modifiers);
16531653
node.dotDotDotToken = dotDotDotToken;
16541654
node.name = asName(name);
@@ -7308,7 +7308,7 @@ function getTransformFlagsSubtreeExclusions(kind: SyntaxKind) {
73087308
return TransformFlags.ArrayLiteralOrCallOrNewExcludes;
73097309
case SyntaxKind.ModuleDeclaration:
73107310
return TransformFlags.ModuleExcludes;
7311-
case SyntaxKind.Parameter:
7311+
case SyntaxKind.ParameterDeclaration:
73127312
return TransformFlags.ParameterExcludes;
73137313
case SyntaxKind.ArrowFunction:
73147314
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
@@ -975,7 +975,7 @@ export function getTargetOfBindingOrAssignmentElement(bindingElement: BindingOrA
975975
*/
976976
export function getRestIndicatorOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): BindingOrAssignmentElementRestIndicator | undefined {
977977
switch (bindingElement.kind) {
978-
case SyntaxKind.Parameter:
978+
case SyntaxKind.ParameterDeclaration:
979979
case SyntaxKind.BindingElement:
980980
// `...` in `let [...a] = ...`
981981
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
@@ -522,7 +522,7 @@ const forEachChildTable: ForEachChildTable = {
522522
[SyntaxKind.SpreadAssignment]: function forEachChildInSpreadAssignment<T>(node: SpreadAssignment, cbNode: (node: Node) => T | undefined, _cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
523523
return visitNode(cbNode, node.expression);
524524
},
525-
[SyntaxKind.Parameter]: function forEachChildInParameter<T>(node: ParameterDeclaration, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
525+
[SyntaxKind.ParameterDeclaration]: function forEachChildInParameter<T>(node: ParameterDeclaration, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray<Node>) => T | undefined): T | undefined {
526526
return visitNodes(cbNode, cbNodes, node.modifiers) ||
527527
visitNode(cbNode, node.dotDotDotToken) ||
528528
visitNode(cbNode, node.name) ||
@@ -3377,7 +3377,7 @@ namespace Parser {
33773377
}
33783378

33793379
function isReusableParameter(node: Node) {
3380-
if (node.kind !== SyntaxKind.Parameter) {
3380+
if (node.kind !== SyntaxKind.ParameterDeclaration) {
33813381
return false;
33823382
}
33833383

src/compiler/program.ts

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

31173117
switch (parent.kind) {
3118-
case SyntaxKind.Parameter:
3118+
case SyntaxKind.ParameterDeclaration:
31193119
case SyntaxKind.PropertyDeclaration:
31203120
case SyntaxKind.MethodDeclaration:
31213121
if ((parent as ParameterDeclaration | PropertyDeclaration | MethodDeclaration).questionToken === node) {
@@ -3289,7 +3289,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
32893289
return "skip";
32903290
}
32913291
break;
3292-
case SyntaxKind.Parameter:
3292+
case SyntaxKind.ParameterDeclaration:
32933293
// Check modifiers of parameter declaration
32943294
if (nodes === (parent as ParameterDeclaration).modifiers && some(nodes, isModifier)) {
32953295
diagnostics.push(createDiagnosticForNodeArray(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files));

0 commit comments

Comments
 (0)