MCPcopy
hub / github.com/jquery/esprima / parseJSXElement

Method parseJSXElement

src/jsx-parser.ts:589–603  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

587 }
588
589 parseJSXElement(): JSXNode.JSXElement {
590 const node = this.createJSXNode();
591
592 const opening = this.parseJSXOpeningElement();
593 let children: JSXNode.JSXChild[] = [];
594 let closing: JSXNode.JSXClosingElement | null = null;
595
596 if (!opening.selfClosing) {
597 const el = this.parseComplexJSXElement({ node, opening, closing, children });
598 children = el.children;
599 closing = el.closing;
600 }
601
602 return this.finalize(node, new JSXNode.JSXElement(opening, children, closing));
603 }
604
605 parseJSXRoot(): JSXNode.JSXElement {
606 // Pop the opening '<' added from the lookahead.

Callers 2

parseJSXRootMethod · 0.95

Calls 4

createJSXNodeMethod · 0.95
finalizeMethod · 0.80

Tested by

no test coverage detected