[babel 8] Report a SyntaxError for } and > in JSX text#12451
Conversation
cherry-pick babel#11046 Co-Authored-By: Kai Cataldo <[email protected]> Co-Authored-By: Nicolò Ribaudo <[email protected]>
|
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.
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-devtomain. The only change is that I made the error recoverable (just by deletingthrowin front ofthis.raise).