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

Function isReusableClassMember

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

Source from the content-addressed store, hash-verified

32887 return false;
32888 }
32889 function isReusableClassMember(node) {
32890 if (node) {
32891 switch (node.kind) {
32892 case 171 /* SyntaxKind.Constructor */:
32893 case 176 /* SyntaxKind.IndexSignature */:
32894 case 172 /* SyntaxKind.GetAccessor */:
32895 case 173 /* SyntaxKind.SetAccessor */:
32896 case 167 /* SyntaxKind.PropertyDeclaration */:
32897 case 234 /* SyntaxKind.SemicolonClassElement */:
32898 return true;
32899 case 169 /* SyntaxKind.MethodDeclaration */:
32900 // Method declarations are not necessarily reusable. An object-literal
32901 // may have a method calls "constructor(...)" and we must reparse that
32902 // into an actual .ConstructorDeclaration.
32903 var methodDeclaration = node;
32904 var nameIsConstructor = methodDeclaration.name.kind === 79 /* SyntaxKind.Identifier */ &&
32905 methodDeclaration.name.originalKeywordKind === 134 /* SyntaxKind.ConstructorKeyword */;
32906 return !nameIsConstructor;
32907 }
32908 }
32909 return false;
32910 }
32911 function isReusableSwitchClause(node) {
32912 if (node) {
32913 switch (node.kind) {

Callers 1

canReuseNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected