Skip to content

Commit 6b476b2

Browse files
committed
CR feedback
1 parent 4aec447 commit 6b476b2

File tree

4 files changed

+121
-0
lines changed

4 files changed

+121
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//// [tests/cases/conformance/jsx/tsxReactEmit5.tsx] ////
2+
3+
//// [file.tsx]
4+
5+
declare module JSX {
6+
interface Element { }
7+
interface IntrinsicElements {
8+
[s: string]: any;
9+
}
10+
}
11+
12+
//// [test.d.ts]
13+
export var React;
14+
15+
//// [react-consumer.tsx]
16+
import {React} from "./test";
17+
// Should emit test_1.React.createElement
18+
// and React.__spread
19+
var foo;
20+
var spread1 = <div x='' {...foo} y='' />;
21+
22+
23+
//// [file.js]
24+
//// [react-consumer.js]
25+
var test_1 = require("./test");
26+
// Should emit test_1.React.createElement
27+
// and React.__spread
28+
var foo;
29+
var spread1 = test_1.React.createElement("div", test_1.React.__spread({x: ''}, foo, {y: ''}));
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
=== tests/cases/conformance/jsx/file.tsx ===
2+
3+
declare module JSX {
4+
>JSX : Symbol(JSX, Decl(file.tsx, 0, 0))
5+
6+
interface Element { }
7+
>Element : Symbol(Element, Decl(file.tsx, 1, 20))
8+
9+
interface IntrinsicElements {
10+
>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 2, 22))
11+
12+
[s: string]: any;
13+
>s : Symbol(s, Decl(file.tsx, 4, 3))
14+
}
15+
}
16+
17+
=== tests/cases/conformance/jsx/test.d.ts ===
18+
export var React;
19+
>React : Symbol(React, Decl(test.d.ts, 0, 10))
20+
21+
=== tests/cases/conformance/jsx/react-consumer.tsx ===
22+
import {React} from "./test";
23+
>React : Symbol(React, Decl(react-consumer.tsx, 0, 8))
24+
25+
// Should emit test_1.React.createElement
26+
// and React.__spread
27+
var foo;
28+
>foo : Symbol(foo, Decl(react-consumer.tsx, 3, 3))
29+
30+
var spread1 = <div x='' {...foo} y='' />;
31+
>spread1 : Symbol(spread1, Decl(react-consumer.tsx, 4, 3))
32+
>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 2, 22))
33+
>x : Symbol(unknown)
34+
>y : Symbol(unknown)
35+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
=== tests/cases/conformance/jsx/file.tsx ===
2+
3+
declare module JSX {
4+
>JSX : any
5+
6+
interface Element { }
7+
>Element : Element
8+
9+
interface IntrinsicElements {
10+
>IntrinsicElements : IntrinsicElements
11+
12+
[s: string]: any;
13+
>s : string
14+
}
15+
}
16+
17+
=== tests/cases/conformance/jsx/test.d.ts ===
18+
export var React;
19+
>React : any
20+
21+
=== tests/cases/conformance/jsx/react-consumer.tsx ===
22+
import {React} from "./test";
23+
>React : any
24+
25+
// Should emit test_1.React.createElement
26+
// and React.__spread
27+
var foo;
28+
>foo : any
29+
30+
var spread1 = <div x='' {...foo} y='' />;
31+
>spread1 : JSX.Element
32+
><div x='' {...foo} y='' /> : JSX.Element
33+
>div : any
34+
>x : any
35+
>foo : any
36+
>y : any
37+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@jsx: react
2+
//@module: commonjs
3+
4+
//@filename: file.tsx
5+
declare module JSX {
6+
interface Element { }
7+
interface IntrinsicElements {
8+
[s: string]: any;
9+
}
10+
}
11+
12+
//@filename: test.d.ts
13+
export var React;
14+
15+
//@filename: react-consumer.tsx
16+
import {React} from "./test";
17+
// Should emit test_1.React.createElement
18+
// and React.__spread
19+
var foo;
20+
var spread1 = <div x='' {...foo} y='' />;

0 commit comments

Comments
 (0)