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

Function parseJsxChildren

test/fixtures/snapshot/typescript.js:35300–35320  ·  view source on GitHub ↗
(openingTag)

Source from the content-addressed store, hash-verified

35298 }
35299 }
35300 function parseJsxChildren(openingTag) {
35301 var list = [];
35302 var listPos = getNodePos();
35303 var saveParsingContext = parsingContext;
35304 parsingContext |= 1 << 14 /* ParsingContext.JsxChildren */;
35305 while (true) {
35306 var child = parseJsxChild(openingTag, currentToken = scanner.reScanJsxToken());
35307 if (!child)
35308 break;
35309 list.push(child);
35310 if (ts.isJsxOpeningElement(openingTag)
35311 && (child === null || child === void 0 ? void 0 : child.kind) === 278 /* SyntaxKind.JsxElement */
35312 && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName)
35313 && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) {
35314 // stop after parsing a mismatched child like <div>...(<span></div>) in order to reattach the </div> higher
35315 break;
35316 }
35317 }
35318 parsingContext = saveParsingContext;
35319 return createNodeArray(list, listPos);
35320 }
35321 function parseJsxAttributes() {
35322 var pos = getNodePos();
35323 return finishNode(factory.createJsxAttributes(parseList(13 /* ParsingContext.JsxAttributes */, parseJsxAttribute)), pos);

Calls 5

getNodePosFunction · 0.85
parseJsxChildFunction · 0.85
tagNamesAreEquivalentFunction · 0.85
createNodeArrayFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…