Skip to content

Commit a9742c5

Browse files
author
Andy Hanson
committed
Change name from ConstructorParameterModifier to ParameterPropertyModifier
1 parent ad2634e commit a9742c5

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12658,7 +12658,7 @@ namespace ts {
1265812658

1265912659
checkVariableLikeDeclaration(node);
1266012660
let func = getContainingFunction(node);
12661-
if (node.flags & NodeFlags.ConstructorParameterModifier) {
12661+
if (node.flags & NodeFlags.ParameterPropertyModifier) {
1266212662
func = getContainingFunction(node);
1266312663
if (!(func.kind === SyntaxKind.Constructor && nodeIsPresent(func.body))) {
1266412664
error(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
@@ -12994,7 +12994,7 @@ namespace ts {
1299412994
// or the containing class declares instance member variables with initializers.
1299512995
const superCallShouldBeFirst =
1299612996
forEach((<ClassDeclaration>node.parent).members, isInstancePropertyWithInitializer) ||
12997-
forEach(node.parameters, p => p.flags & NodeFlags.ConstructorParameterModifier);
12997+
forEach(node.parameters, p => p.flags & NodeFlags.ParameterPropertyModifier);
1299812998

1299912999
// Skip past any prologue directives to find the first statement
1300013000
// to ensure that it was a super call.
@@ -17760,7 +17760,7 @@ namespace ts {
1776017760
else if ((node.kind === SyntaxKind.ImportDeclaration || node.kind === SyntaxKind.ImportEqualsDeclaration) && flags & NodeFlags.Ambient) {
1776117761
return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare");
1776217762
}
17763-
else if (node.kind === SyntaxKind.Parameter && (flags & NodeFlags.ConstructorParameterModifier) && isBindingPattern((<ParameterDeclaration>node).name)) {
17763+
else if (node.kind === SyntaxKind.Parameter && (flags & NodeFlags.ParameterPropertyModifier) && isBindingPattern((<ParameterDeclaration>node).name)) {
1776417764
return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_a_binding_pattern);
1776517765
}
1776617766
if (flags & NodeFlags.Async) {

src/compiler/declarationEmitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ namespace ts {
10511051
function emitParameterProperties(constructorDeclaration: ConstructorDeclaration) {
10521052
if (constructorDeclaration) {
10531053
forEach(constructorDeclaration.parameters, param => {
1054-
if (param.flags & NodeFlags.ConstructorParameterModifier) {
1054+
if (param.flags & NodeFlags.ParameterPropertyModifier) {
10551055
emitPropertyDeclaration(param);
10561056
}
10571057
});

src/compiler/emitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4979,7 +4979,7 @@ const _super = (function (geti, seti) {
49794979

49804980
function emitParameterPropertyAssignments(node: ConstructorDeclaration) {
49814981
forEach(node.parameters, param => {
4982-
if (param.flags & NodeFlags.ConstructorParameterModifier) {
4982+
if (param.flags & NodeFlags.ParameterPropertyModifier) {
49834983
writeLine();
49844984
emitStart(param);
49854985
emitStart(param.name);

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ namespace ts {
410410
Modifier = Export | Ambient | Public | Private | Protected | Static | Abstract | Default | Async | Readonly,
411411
AccessibilityModifier = Public | Private | Protected,
412412
// Accessibility modifiers and 'readonly' can be attached to a parameter in a constructor to make it a property.
413-
ConstructorParameterModifier = AccessibilityModifier | Readonly,
413+
ParameterPropertyModifier = AccessibilityModifier | Readonly,
414414
BlockScoped = Let | Const,
415415

416416
ReachabilityCheckFlags = HasImplicitReturn | HasExplicitReturn,

src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3021,7 +3021,7 @@ namespace ts {
30213021
}
30223022

30233023
export function isParameterPropertyDeclaration(node: ParameterDeclaration): boolean {
3024-
return node.flags & NodeFlags.ConstructorParameterModifier && node.parent.kind === SyntaxKind.Constructor && isClassLike(node.parent.parent);
3024+
return node.flags & NodeFlags.ParameterPropertyModifier && node.parent.kind === SyntaxKind.Constructor && isClassLike(node.parent.parent);
30253025
}
30263026

30273027
export function startsWith(str: string, prefix: string): boolean {

0 commit comments

Comments
 (0)