jsx: fix sequence expression at JSXAttributeValue#8787
jsx: fix sequence expression at JSXAttributeValue#8787nicolo-ribaudo merged 3 commits intobabel:next-8-devfrom
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/9404/ |
|
Instead of parsing an Expression and then throw if it is a SequenceExpression, we can parse an AssignmentExpression since the beginning. |
|
@nicolo-ribaudo Where is the |
|
You can use |
f36c6ee to
80478f8
Compare
|
@nicolo-ribaudo I updated the code 😄 |
|
Since in a past meeting we had concerns that this PR could break someone's code, here is a summary of what other parsers do when parsing
Bonus: Pretter prints it as |
|
We discussed about flag, breaking change, warning etc during our Babel meeting. We'll follow back. |
|
Sorry for not being at the meeting. I'm very busy at last days 😞 @xtuc What were the outputs of the meeting? |
|
For now we are not merging this PR since, as shown in #8787 (comment), many tools allow sequence expression and thus some people may rely on it. |
|
I'm merging this to the |
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
* jsx: fix sequence expression at JSXAttributeValue * Change logic for detecting unparenthesized expressions * use parseMaybeAssign instead of custom error handling Co-authored-by: Daniel Tschinder <[email protected]>
Following #8604, we should not allow codes like these
But we should allow codes like
This PR fixes it, raising an exception with this message:
Sequence of values at JSX must be parenthesized.But, since we currently allow the wrong code, this fix is a breaking change.