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

Function visitCatchClauseInAsyncBody

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

Source from the content-addressed store, hash-verified

96031 return visitor(node);
96032 }
96033 function visitCatchClauseInAsyncBody(node) {
96034 var catchClauseNames = new ts.Set();
96035 recordDeclarationName(node.variableDeclaration, catchClauseNames); // TODO: GH#18217
96036 // names declared in a catch variable are block scoped
96037 var catchClauseUnshadowedNames;
96038 catchClauseNames.forEach(function (_, escapedName) {
96039 if (enclosingFunctionParameterNames.has(escapedName)) {
96040 if (!catchClauseUnshadowedNames) {
96041 catchClauseUnshadowedNames = new ts.Set(enclosingFunctionParameterNames);
96042 }
96043 catchClauseUnshadowedNames.delete(escapedName);
96044 }
96045 });
96046 if (catchClauseUnshadowedNames) {
96047 var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
96048 enclosingFunctionParameterNames = catchClauseUnshadowedNames;
96049 var result = ts.visitEachChild(node, asyncBodyVisitor, context);
96050 enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames;
96051 return result;
96052 }
96053 else {
96054 return ts.visitEachChild(node, asyncBodyVisitor, context);
96055 }
96056 }
96057 function visitVariableStatementInAsyncBody(node) {
96058 if (isVariableDeclarationListWithCollidingName(node.declarationList)) {
96059 var expression = visitVariableDeclarationListWithCollidingNames(node.declarationList, /*hasReceiver*/ false);

Callers 1

asyncBodyVisitorFunction · 0.85

Calls 4

recordDeclarationNameFunction · 0.85
forEachMethod · 0.65
hasMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected