Bug Report
Current Behavior
Code like <div>{3, 1}</div> is not treated as a parse error, but it should be.
REPL link
Input Code
// No error
<div>{3, 1}</div>;
// No error
<div foo={1, 2} />;
Expected behavior/code
Expected a parse error.
The JSX Spec specifies JSXChildExpression and JSXAttributeValue as being { AssignmentExpression }, but the comma expression is above AssignmentExpression in the grammar
Environment
- Babel version(s): 6.26.0
- Node/npm version: N/A (repl)
- OS: N/A (repl)
- Monorepo N/A (repl)
- How you are using Babel: N/A (repl)
Possible Solution
Additional context/Screenshots
https://stackoverflow.com/questions/52139174/comma-operator-in-typescript-jsx-expressions
Bug Report
Current Behavior
Code like
<div>{3, 1}</div>is not treated as a parse error, but it should be.REPL link
Input Code
Expected behavior/code
Expected a parse error.
The JSX Spec specifies
JSXChildExpressionandJSXAttributeValueas being{AssignmentExpression}, but the comma expression is aboveAssignmentExpressionin the grammarEnvironment
Possible Solution
Additional context/Screenshots
https://stackoverflow.com/questions/52139174/comma-operator-in-typescript-jsx-expressions