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

Function visitCatchClause

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

Source from the content-addressed store, hash-verified

96833 return factory.updateCommaListExpression(node, elements);
96834 }
96835 function visitCatchClause(node) {
96836 if (node.variableDeclaration &&
96837 ts.isBindingPattern(node.variableDeclaration.name) &&
96838 node.variableDeclaration.name.transformFlags & 32768 /* TransformFlags.ContainsObjectRestOrSpread */) {
96839 var name = factory.getGeneratedNameForNode(node.variableDeclaration.name);
96840 var updatedDecl = factory.updateVariableDeclaration(node.variableDeclaration, node.variableDeclaration.name, /*exclamationToken*/ undefined, /*type*/ undefined, name);
96841 var visitedBindings = ts.flattenDestructuringBinding(updatedDecl, visitor, context, 1 /* FlattenLevel.ObjectRest */);
96842 var block = ts.visitNode(node.block, visitor, ts.isBlock);
96843 if (ts.some(visitedBindings)) {
96844 block = factory.updateBlock(block, __spreadArray([
96845 factory.createVariableStatement(/*modifiers*/ undefined, visitedBindings)
96846 ], block.statements, true));
96847 }
96848 return factory.updateCatchClause(node, factory.updateVariableDeclaration(node.variableDeclaration, name, /*exclamationToken*/ undefined, /*type*/ undefined, /*initializer*/ undefined), block);
96849 }
96850 return ts.visitEachChild(node, visitor, context);
96851 }
96852 function visitVariableStatement(node) {
96853 if (ts.hasSyntacticModifier(node, 1 /* ModifierFlags.Export */)) {
96854 var savedExportedVariableStatement = exportedVariableStatement;

Callers 3

visitorWorkerFunction · 0.85
visitorFunction · 0.85
topLevelNestedVisitorFunction · 0.85

Calls 5

enterSubtreeFunction · 0.85
exitSubtreeFunction · 0.85
someMethod · 0.80
assertMethod · 0.80

Tested by

no test coverage detected