File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -32224,6 +32224,11 @@ namespace ts {
32224
32224
if (hasSyntacticModifier(node, ModifierFlags.Abstract) && node.kind === SyntaxKind.MethodDeclaration && node.body) {
32225
32225
error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
32226
32226
}
32227
+
32228
+ // Private named methods are only allowed in class declarations
32229
+ if (isPrivateIdentifier(node.name) && !isClassDeclaration(node.parent)) {
32230
+ error(node, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
32231
+ }
32227
32232
}
32228
32233
32229
32234
function checkConstructorDeclaration(node: ConstructorDeclaration) {
@@ -40007,7 +40012,7 @@ namespace ts {
40007
40012
}
40008
40013
40009
40014
if (name.kind === SyntaxKind.PrivateIdentifier) {
40010
- return grammarErrorOnNode(name, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
40015
+ grammarErrorOnNode(name, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
40011
40016
}
40012
40017
40013
40018
// Modifiers are never allowed on properties except for 'async' on a method declaration
You can’t perform that action at this time.
0 commit comments