mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
42 lines
1019 B
TypeScript
42 lines
1019 B
TypeScript
//@filename: file.tsx
|
|
//@jsx: preserve
|
|
declare module JSX {
|
|
interface Element { }
|
|
interface IntrinsicElements {
|
|
[s: string]: any;
|
|
}
|
|
}
|
|
|
|
var p;
|
|
var selfClosed1 = <div />;
|
|
var selfClosed2 = <div x="1" />;
|
|
var selfClosed3 = <div x='1' />;
|
|
var selfClosed4 = <div x="1" y='0' />;
|
|
var selfClosed5 = <div x={0} y='0' />;
|
|
var selfClosed6 = <div x={"1"} y='0' />;
|
|
var selfClosed7 = <div x={p} y='p' />;
|
|
|
|
var openClosed1 = <div></div>;
|
|
var openClosed2 = <div n='m'>foo</div>;
|
|
var openClosed3 = <div n='m'>{p}</div>;
|
|
var openClosed4 = <div n='m'>{p < p}</div>;
|
|
var openClosed5 = <div n='m'>{p > p}</div>;
|
|
|
|
class SomeClass {
|
|
f() {
|
|
var rewrites1 = <div>{() => this}</div>;
|
|
var rewrites2 = <div>{[p, ...p, p]}</div>;
|
|
var rewrites3 = <div>{{p}}</div>;
|
|
|
|
var rewrites4 = <div a={() => this}></div>;
|
|
var rewrites5 = <div a={[p, ...p, p]}></div>;
|
|
var rewrites6 = <div a={{p}}></div>;
|
|
}
|
|
}
|
|
|
|
var whitespace1 = <div> </div>;
|
|
var whitespace2 = <div> {p} </div>;
|
|
var whitespace3 = <div>
|
|
{p}
|
|
</div>;
|