MCPcopy Index your code
hub / github.com/nodejs/node / checkMethodDeclaration

Function checkMethodDeclaration

test/fixtures/snapshot/typescript.js:80446–80461  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

80444 return checkPropertyDeclaration(node);
80445 }
80446 function checkMethodDeclaration(node) {
80447 // Grammar checking
80448 if (!checkGrammarMethod(node))
80449 checkGrammarComputedPropertyName(node.name);
80450 // Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration
80451 checkFunctionOrMethodDeclaration(node);
80452 // method signatures already report "implementation not allowed in ambient context" elsewhere
80453 if (ts.hasSyntacticModifier(node, 128 /* ModifierFlags.Abstract */) && node.kind === 169 /* SyntaxKind.MethodDeclaration */ && node.body) {
80454 error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name));
80455 }
80456 // Private named methods are only allowed in class declarations
80457 if (ts.isPrivateIdentifier(node.name) && !ts.getContainingClass(node)) {
80458 error(node, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
80459 }
80460 setNodeLinksForPrivateIdentifierScope(node);
80461 }
80462 function setNodeLinksForPrivateIdentifierScope(node) {
80463 if (ts.isPrivateIdentifier(node.name) && languageVersion < 99 /* ScriptTarget.ESNext */) {
80464 for (var lexicalScope = ts.getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = ts.getEnclosingBlockScopeContainer(lexicalScope)) {

Callers 1

checkSourceElementWorkerFunction · 0.85

Calls 5

checkGrammarMethodFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…