Skip to content

Parser doesn’t parse BinaryExpression with comma operator as JSXExpression #31510

@andrewbranch

Description

@andrewbranch

TypeScript Version: 9052804

Search Terms: JSX comma expression BinaryExpression

Filing for discoverability. Discovered while working on #25487 that we don't parse either of these correctly:

const x = <div x={p, p} />
const y = <div>{p, p}</div>

In both cases, we should parse a JSXExpression whose expression is a BinaryExpression with a CommaToken as the operator. Both Flow and Babel treat this as valid syntax (they call the expression a "SequenceExpression").

Metadata

Metadata

Assignees

Labels

Working as IntendedThe behavior described is the intended behavior; this is not a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions