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

Method parseJSXBoundaryElement

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

Source from the content-addressed store, hash-verified

479 }
480
481 parseJSXBoundaryElement(): JSXNode.JSXOpeningElement | JSXNode.JSXClosingElement {
482 const node = this.createJSXNode();
483
484 this.expectJSX('<');
485 if (this.matchJSX('/')) {
486 this.expectJSX('/');
487 const name = this.parseJSXElementName();
488 this.expectJSX('>');
489 return this.finalize(node, new JSXNode.JSXClosingElement(name));
490 }
491
492 const name = this.parseJSXElementName();
493 const attributes = this.parseJSXAttributes();
494 const selfClosing = this.matchJSX('/');
495 if (selfClosing) {
496 this.expectJSX('/');
497 }
498 this.expectJSX('>');
499
500 return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
501 }
502
503 parseJSXEmptyExpression(): JSXNode.JSXEmptyExpression {
504 const node = this.createJSXChildNode();

Callers 1

Calls 6

createJSXNodeMethod · 0.95
expectJSXMethod · 0.95
matchJSXMethod · 0.95
parseJSXElementNameMethod · 0.95
parseJSXAttributesMethod · 0.95
finalizeMethod · 0.80

Tested by

no test coverage detected