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

Function forEachYieldExpression

test/fixtures/snapshot/typescript.js:15647–15681  ·  view source on GitHub ↗
(body, visitor)

Source from the content-addressed store, hash-verified

15645 }
15646 ts.forEachReturnStatement = forEachReturnStatement;
15647 function forEachYieldExpression(body, visitor) {
15648 return traverse(body);
15649 function traverse(node) {
15650 switch (node.kind) {
15651 case 224 /* SyntaxKind.YieldExpression */:
15652 visitor(node);
15653 var operand = node.expression;
15654 if (operand) {
15655 traverse(operand);
15656 }
15657 return;
15658 case 260 /* SyntaxKind.EnumDeclaration */:
15659 case 258 /* SyntaxKind.InterfaceDeclaration */:
15660 case 261 /* SyntaxKind.ModuleDeclaration */:
15661 case 259 /* SyntaxKind.TypeAliasDeclaration */:
15662 // These are not allowed inside a generator now, but eventually they may be allowed
15663 // as local types. Regardless, skip them to avoid the work.
15664 return;
15665 default:
15666 if (ts.isFunctionLike(node)) {
15667 if (node.name && node.name.kind === 162 /* SyntaxKind.ComputedPropertyName */) {
15668 // Note that we will not include methods/accessors of a class because they would require
15669 // first descending into the class. This is by design.
15670 traverse(node.name.expression);
15671 return;
15672 }
15673 }
15674 else if (!isPartOfTypeNode(node)) {
15675 // This is the general case, which should include mostly expressions and statements.
15676 // Also includes NodeArrays.
15677 ts.forEachChild(node, traverse);
15678 }
15679 }
15680 }
15681 }
15682 ts.forEachYieldExpression = forEachYieldExpression;
15683 /**
15684 * Gets the most likely element type for a TypeNode. This is not an exhaustive test

Callers

nothing calls this directly

Calls 1

traverseFunction · 0.85

Tested by

no test coverage detected