We should issue an error when parsing `<div x={1, 2} />` as the comma operator is not a legal production in a JSX Expression Fixes (mitigates?) bug #5991
21 lines
391 B
TypeScript
21 lines
391 B
TypeScript
//// [file.tsx]
|
|
|
|
declare module JSX {
|
|
interface Element { }
|
|
interface IntrinsicElements {
|
|
[s: string]: any;
|
|
}
|
|
}
|
|
|
|
// This should be a parse error
|
|
const class1 = "foo";
|
|
const class2 = "bar";
|
|
const elem = <div className={class1, class2}/>;
|
|
|
|
|
|
//// [file.jsx]
|
|
// This should be a parse error
|
|
var class1 = "foo";
|
|
var class2 = "bar";
|
|
var elem = <div className={class1} class2/>;
|
|
/>;;
|