Don't parse out a name for JSX fragments (#52818)

This commit is contained in:
Jake Bailey
2023-02-17 10:55:56 -08:00
committed by GitHub
parent ddfec78f55
commit a3a4993937
5 changed files with 17 additions and 14 deletions

View File

@@ -6151,10 +6151,7 @@ namespace Parser {
function parseJsxClosingFragment(inExpressionContext: boolean): JsxClosingFragment {
const pos = getNodePos();
parseExpected(SyntaxKind.LessThanSlashToken);
if (tokenIsIdentifierOrKeyword(token())) {
parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
}
if (parseExpected(SyntaxKind.GreaterThanToken, /*diagnostic*/ undefined, /*shouldAdvance*/ false)) {
if (parseExpected(SyntaxKind.GreaterThanToken, Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment, /*shouldAdvance*/ false)) {
// manually advance the scanner in order to look for jsx text inside jsx
if (inExpressionContext) {
nextToken();