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

Function visitMethodOrAccessorDeclaration

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

Source from the content-addressed store, hash-verified

94493 return node;
94494 }
94495 function visitMethodOrAccessorDeclaration(node) {
94496 ts.Debug.assert(!ts.some(node.decorators));
94497 if (!shouldTransformPrivateElementsOrClassStaticBlocks || !ts.isPrivateIdentifier(node.name)) {
94498 return ts.visitEachChild(node, classElementVisitor, context);
94499 }
94500 // leave invalid code untransformed
94501 var info = accessPrivateIdentifier(node.name);
94502 ts.Debug.assert(info, "Undeclared private name for property declaration.");
94503 if (!info.isValid) {
94504 return node;
94505 }
94506 var functionName = getHoistedFunctionName(node);
94507 if (functionName) {
94508 getPendingExpressions().push(factory.createAssignment(functionName, factory.createFunctionExpression(ts.filter(node.modifiers, function (m) { return !ts.isStaticModifier(m); }), node.asteriskToken, functionName,
94509 /* typeParameters */ undefined, ts.visitParameterList(node.parameters, classElementVisitor, context),
94510 /* type */ undefined, ts.visitFunctionBody(node.body, classElementVisitor, context))));
94511 }
94512 // remove method declaration from class
94513 return undefined;
94514 }
94515 function getHoistedFunctionName(node) {
94516 ts.Debug.assert(ts.isPrivateIdentifier(node.name));
94517 var info = accessPrivateIdentifier(node.name);

Callers 1

classElementVisitorFunction · 0.85

Calls 7

accessPrivateIdentifierFunction · 0.85
getHoistedFunctionNameFunction · 0.85
getPendingExpressionsFunction · 0.85
assertMethod · 0.80
someMethod · 0.80
filterMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected