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

Function visitElidableStatement

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

Source from the content-addressed store, hash-verified

91737 }
91738 }
91739 function visitElidableStatement(node) {
91740 var parsed = ts.getParseTreeNode(node);
91741 if (parsed !== node) {
91742 // If the node has been transformed by a `before` transformer, perform no ellision on it
91743 // As the type information we would attempt to lookup to perform ellision is potentially unavailable for the synthesized nodes
91744 // We do not reuse `visitorWorker`, as the ellidable statement syntax kinds are technically unrecognized by the switch-case in `visitTypeScript`,
91745 // and will trigger debug failures when debug verbosity is turned up
91746 if (node.transformFlags & 1 /* TransformFlags.ContainsTypeScript */) {
91747 // This node contains TypeScript, so we should visit its children.
91748 return ts.visitEachChild(node, visitor, context);
91749 }
91750 // Otherwise, we can just return the node
91751 return node;
91752 }
91753 switch (node.kind) {
91754 case 266 /* SyntaxKind.ImportDeclaration */:
91755 return visitImportDeclaration(node);
91756 case 265 /* SyntaxKind.ImportEqualsDeclaration */:
91757 return visitImportEqualsDeclaration(node);
91758 case 271 /* SyntaxKind.ExportAssignment */:
91759 return visitExportAssignment(node);
91760 case 272 /* SyntaxKind.ExportDeclaration */:
91761 return visitExportDeclaration(node);
91762 default:
91763 ts.Debug.fail("Unhandled ellided statement");
91764 }
91765 }
91766 /**
91767 * Specialized visitor that visits the immediate children of a namespace.
91768 *

Callers 1

Calls 5

visitImportDeclarationFunction · 0.85
visitExportAssignmentFunction · 0.85
visitExportDeclarationFunction · 0.85
failMethod · 0.45

Tested by

no test coverage detected