MCPcopy Create free account
hub / github.com/nodejs/node / getYieldOccurrences

Function getYieldOccurrences

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

Source from the content-addressed store, hash-verified

135886 return keywords;
135887 }
135888 function getYieldOccurrences(node) {
135889 var func = ts.getContainingFunction(node);
135890 if (!func) {
135891 return undefined;
135892 }
135893 var keywords = [];
135894 ts.forEachChild(func, function (child) {
135895 traverseWithoutCrossingFunction(child, function (node) {
135896 if (ts.isYieldExpression(node)) {
135897 pushKeywordIf(keywords, node.getFirstToken(), 125 /* SyntaxKind.YieldKeyword */);
135898 }
135899 });
135900 });
135901 return keywords;
135902 }
135903 // Do not cross function/class/interface/module/type boundaries.
135904 function traverseWithoutCrossingFunction(node, cb) {
135905 cb(node);

Callers 1

getHighlightSpansFunction · 0.85

Calls 3

pushKeywordIfFunction · 0.85
forEachChildMethod · 0.80

Tested by

no test coverage detected