Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't recover from "adjacent jsx elements" parser error #10682

Merged
merged 1 commit into from Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 2 additions & 8 deletions packages/babel-parser/src/plugins/jsx/index.js
Expand Up @@ -484,18 +484,12 @@ export default (superClass: Class<Parser>): Class<Parser> =>
node.closingElement = closingElement;
}
node.children = children;
while (this.isRelational("<")) {
// In case we encounter an lt token here it will always be the start of
// jsx as the lt sign is not allowed in places that expect an expression
this.finishToken(tt.jsxTagStart);

this.raise(
if (this.isRelational("<")) {
throw this.raise(
this.state.start,
"Adjacent JSX elements must be wrapped in an enclosing tag. " +
"Did you want a JSX fragment <>...</>?",
);

this.jsxParseElement();
}

return isFragment(openingElement)
Expand Down
@@ -0,0 +1,3 @@
{
"throws": "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? (1:22)"
}

This file was deleted.