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

Function getElaborationElementForJsxChild

test/fixtures/snapshot/typescript.js:64129–64148  ·  view source on GitHub ↗
(child, nameType, getInvalidTextDiagnostic)

Source from the content-addressed store, hash-verified

64127 });
64128 }
64129 function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) {
64130 switch (child.kind) {
64131 case 288 /* SyntaxKind.JsxExpression */:
64132 // child is of the type of the expression
64133 return { errorNode: child, innerExpression: child.expression, nameType: nameType };
64134 case 11 /* SyntaxKind.JsxText */:
64135 if (child.containsOnlyTriviaWhiteSpaces) {
64136 break; // Whitespace only jsx text isn't real jsx text
64137 }
64138 // child is a string
64139 return { errorNode: child, innerExpression: undefined, nameType: nameType, errorMessage: getInvalidTextDiagnostic() };
64140 case 278 /* SyntaxKind.JsxElement */:
64141 case 279 /* SyntaxKind.JsxSelfClosingElement */:
64142 case 282 /* SyntaxKind.JsxFragment */:
64143 // child is of type JSX.Element
64144 return { errorNode: child, innerExpression: child, nameType: nameType };
64145 default:
64146 return ts.Debug.assertNever(child, "Found invalid jsx child");
64147 }
64148 }
64149 function elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer) {
64150 var result = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer);
64151 var invalidTextDiagnostic;

Callers 2

generateJsxChildrenFunction · 0.85
elaborateJsxComponentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…