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
[babel 8] Report a SyntaxError for }
and >
in JSX text
#12451
[babel 8] Report a SyntaxError for }
and >
in JSX text
#12451
Conversation
cherry-pick babel#11046 Co-Authored-By: Kai Cataldo <kai@kaicataldo.com> Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/34166/ |
); | ||
} | ||
/* falls through */ | ||
|
||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make prepublish-build
generates this code:
case 62:
case 125:
default:
while BABEL_8_BREAKING=true make prepublish-build
generates this: (with the first commit of #12447 that fixes the boolean logic in the build process)
case 62:
case 125:
{
const htmlEntity = ch === 125 ? "}" : ">";
const char = this.input[this.state.pos];
this.raise(this.state.pos, `Unexpected token \`${char}\`. Did you mean \`${htmlEntity}\` or \`{'${char}'}\`?`);
}
default:
}
and >
in JSX text}
and >
in JSX text
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 3b3688d:
|
Does this mean users can optionally enable new syntax? |
No, at the moment we strip away the flag at build time. |
This PR is moving #11046 from
babel-8-dev
tomain
. The only change is that I made the error recoverable (just by deletingthrow
in front ofthis.raise
).