Skip to content

Commit 9a23b75

Browse files
author
Kanchalai Tanglertsampan
committed
Update baselines and tests (2)
1 parent dbf2a96 commit 9a23b75

28 files changed

+555
-75
lines changed

tests/baselines/reference/checkJsxChildrenProperty1.symbols

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ function Comp(p: Prop) {
2323
>Prop : Symbol(Prop, Decl(file.tsx, 0, 32))
2424

2525
return <div>{p.b}</div>;
26-
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
26+
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2401, 45))
2727
>p.b : Symbol(Prop.b, Decl(file.tsx, 3, 14))
2828
>p : Symbol(p, Decl(file.tsx, 8, 14))
2929
>b : Symbol(Prop.b, Decl(file.tsx, 3, 14))
30-
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
30+
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2401, 45))
3131
}
3232

3333
// OK
@@ -59,8 +59,8 @@ let k2 =
5959
>b : Symbol(b, Decl(file.tsx, 19, 16))
6060

6161
<div>hi hi hi!</div>
62-
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
63-
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2397, 45))
62+
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2401, 45))
63+
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2401, 45))
6464

6565
</Comp>;
6666
>Comp : Symbol(Comp, Decl(file.tsx, 6, 1))
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//// [file.tsx]
2+
declare module JSX {
3+
interface Element { }
4+
interface ElementAttributesProperty { props: {} }
5+
interface IntrinsicElements {
6+
div: any;
7+
h2: any;
8+
h1: any;
9+
}
10+
}
11+
12+
class Button {
13+
props: {}
14+
render() {
15+
return (<div>My Button</div>)
16+
}
17+
}
18+
19+
// OK
20+
let k1 = <div> <h2> Hello </h2> <h1> world </h1></div>;
21+
let k2 = <div> <h2> Hello </h2> {(user: any) => <h2>{user.name}</h2>}</div>;
22+
let k3 = <div> {1} {"That is a number"} </div>;
23+
let k4 = <Button> <h2> Hello </h2> </Button>;
24+
25+
//// [file.jsx]
26+
var Button = (function () {
27+
function Button() {
28+
}
29+
Button.prototype.render = function () {
30+
return (<div>My Button</div>);
31+
};
32+
return Button;
33+
}());
34+
// OK
35+
var k1 = <div> <h2> Hello </h2> <h1> world </h1></div>;
36+
var k2 = <div> <h2> Hello </h2> {function (user) { return <h2>{user.name}</h2>; }}</div>;
37+
var k3 = <div> {1} {"That is a number"} </div>;
38+
var k4 = <Button> <h2> Hello </h2> </Button>;
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
=== tests/cases/conformance/jsx/file.tsx ===
2+
declare module JSX {
3+
>JSX : Symbol(JSX, Decl(file.tsx, 0, 0))
4+
5+
interface Element { }
6+
>Element : Symbol(Element, Decl(file.tsx, 0, 20))
7+
8+
interface ElementAttributesProperty { props: {} }
9+
>ElementAttributesProperty : Symbol(ElementAttributesProperty, Decl(file.tsx, 1, 22))
10+
>props : Symbol(ElementAttributesProperty.props, Decl(file.tsx, 2, 38))
11+
12+
interface IntrinsicElements {
13+
>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 2, 50))
14+
15+
div: any;
16+
>div : Symbol(IntrinsicElements.div, Decl(file.tsx, 3, 30))
17+
18+
h2: any;
19+
>h2 : Symbol(IntrinsicElements.h2, Decl(file.tsx, 4, 11))
20+
21+
h1: any;
22+
>h1 : Symbol(IntrinsicElements.h1, Decl(file.tsx, 5, 10))
23+
}
24+
}
25+
26+
class Button {
27+
>Button : Symbol(Button, Decl(file.tsx, 8, 1))
28+
29+
props: {}
30+
>props : Symbol(Button.props, Decl(file.tsx, 10, 14))
31+
32+
render() {
33+
>render : Symbol(Button.render, Decl(file.tsx, 11, 10))
34+
35+
return (<div>My Button</div>)
36+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
37+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
38+
}
39+
}
40+
41+
// OK
42+
let k1 = <div> <h2> Hello </h2> <h1> world </h1></div>;
43+
>k1 : Symbol(k1, Decl(file.tsx, 18, 3))
44+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
45+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
46+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
47+
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(file.tsx, 5, 10))
48+
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(file.tsx, 5, 10))
49+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
50+
51+
let k2 = <div> <h2> Hello </h2> {(user: any) => <h2>{user.name}</h2>}</div>;
52+
>k2 : Symbol(k2, Decl(file.tsx, 19, 3))
53+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
54+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
55+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
56+
>user : Symbol(user, Decl(file.tsx, 19, 34))
57+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
58+
>user : Symbol(user, Decl(file.tsx, 19, 34))
59+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
60+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
61+
62+
let k3 = <div> {1} {"That is a number"} </div>;
63+
>k3 : Symbol(k3, Decl(file.tsx, 20, 3))
64+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
65+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
66+
67+
let k4 = <Button> <h2> Hello </h2> </Button>;
68+
>k4 : Symbol(k4, Decl(file.tsx, 21, 3))
69+
>Button : Symbol(Button, Decl(file.tsx, 8, 1))
70+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
71+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
72+
>Button : Symbol(Button, Decl(file.tsx, 8, 1))
73+
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
=== tests/cases/conformance/jsx/file.tsx ===
2+
declare module JSX {
3+
>JSX : any
4+
5+
interface Element { }
6+
>Element : Element
7+
8+
interface ElementAttributesProperty { props: {} }
9+
>ElementAttributesProperty : ElementAttributesProperty
10+
>props : {}
11+
12+
interface IntrinsicElements {
13+
>IntrinsicElements : IntrinsicElements
14+
15+
div: any;
16+
>div : any
17+
18+
h2: any;
19+
>h2 : any
20+
21+
h1: any;
22+
>h1 : any
23+
}
24+
}
25+
26+
class Button {
27+
>Button : Button
28+
29+
props: {}
30+
>props : {}
31+
32+
render() {
33+
>render : () => JSX.Element
34+
35+
return (<div>My Button</div>)
36+
>(<div>My Button</div>) : JSX.Element
37+
><div>My Button</div> : JSX.Element
38+
>div : any
39+
>div : any
40+
}
41+
}
42+
43+
// OK
44+
let k1 = <div> <h2> Hello </h2> <h1> world </h1></div>;
45+
>k1 : JSX.Element
46+
><div> <h2> Hello </h2> <h1> world </h1></div> : JSX.Element
47+
>div : any
48+
><h2> Hello </h2> : JSX.Element
49+
>h2 : any
50+
>h2 : any
51+
><h1> world </h1> : JSX.Element
52+
>h1 : any
53+
>h1 : any
54+
>div : any
55+
56+
let k2 = <div> <h2> Hello </h2> {(user: any) => <h2>{user.name}</h2>}</div>;
57+
>k2 : JSX.Element
58+
><div> <h2> Hello </h2> {(user: any) => <h2>{user.name}</h2>}</div> : JSX.Element
59+
>div : any
60+
><h2> Hello </h2> : JSX.Element
61+
>h2 : any
62+
>h2 : any
63+
>(user: any) => <h2>{user.name}</h2> : (user: any) => JSX.Element
64+
>user : any
65+
><h2>{user.name}</h2> : JSX.Element
66+
>h2 : any
67+
>user.name : any
68+
>user : any
69+
>name : any
70+
>h2 : any
71+
>div : any
72+
73+
let k3 = <div> {1} {"That is a number"} </div>;
74+
>k3 : JSX.Element
75+
><div> {1} {"That is a number"} </div> : JSX.Element
76+
>div : any
77+
>1 : 1
78+
>"That is a number" : "That is a number"
79+
>div : any
80+
81+
let k4 = <Button> <h2> Hello </h2> </Button>;
82+
>k4 : JSX.Element
83+
><Button> <h2> Hello </h2> </Button> : JSX.Element
84+
>Button : typeof Button
85+
><h2> Hello </h2> : JSX.Element
86+
>h2 : any
87+
>h2 : any
88+
>Button : typeof Button
89+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//// [file.tsx]
2+
declare module JSX {
3+
interface Element { }
4+
interface ElementAttributesProperty { props: {} }
5+
interface IntrinsicElements {
6+
div: any;
7+
h2: any;
8+
h1: any;
9+
}
10+
}
11+
12+
class Button {
13+
props: {}
14+
render() {
15+
return (<div>My Button</div>)
16+
}
17+
}
18+
19+
// OK
20+
let k1 = <div> <h2> Hello </h2> <h1> world </h1></div>;
21+
let k2 = <div> <h2> Hello </h2> {(user: any) => <h2>{user.name}</h2>}</div>;
22+
let k3 = <div> {1} {"That is a number"} </div>;
23+
let k4 = <Button> <h2> Hello </h2> </Button>;
24+
25+
//// [file.jsx]
26+
var Button = (function () {
27+
function Button() {
28+
}
29+
Button.prototype.render = function () {
30+
return (<div>My Button</div>);
31+
};
32+
return Button;
33+
}());
34+
// OK
35+
var k1 = <div> <h2> Hello </h2> <h1> world </h1></div>;
36+
var k2 = <div> <h2> Hello </h2> {function (user) { return <h2>{user.name}</h2>; }}</div>;
37+
var k3 = <div> {1} {"That is a number"} </div>;
38+
var k4 = <Button> <h2> Hello </h2> </Button>;
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
=== tests/cases/conformance/jsx/file.tsx ===
2+
declare module JSX {
3+
>JSX : Symbol(JSX, Decl(file.tsx, 0, 0))
4+
5+
interface Element { }
6+
>Element : Symbol(Element, Decl(file.tsx, 0, 20))
7+
8+
interface ElementAttributesProperty { props: {} }
9+
>ElementAttributesProperty : Symbol(ElementAttributesProperty, Decl(file.tsx, 1, 22))
10+
>props : Symbol(ElementAttributesProperty.props, Decl(file.tsx, 2, 38))
11+
12+
interface IntrinsicElements {
13+
>IntrinsicElements : Symbol(IntrinsicElements, Decl(file.tsx, 2, 50))
14+
15+
div: any;
16+
>div : Symbol(IntrinsicElements.div, Decl(file.tsx, 3, 30))
17+
18+
h2: any;
19+
>h2 : Symbol(IntrinsicElements.h2, Decl(file.tsx, 4, 11))
20+
21+
h1: any;
22+
>h1 : Symbol(IntrinsicElements.h1, Decl(file.tsx, 5, 10))
23+
}
24+
}
25+
26+
class Button {
27+
>Button : Symbol(Button, Decl(file.tsx, 8, 1))
28+
29+
props: {}
30+
>props : Symbol(Button.props, Decl(file.tsx, 10, 14))
31+
32+
render() {
33+
>render : Symbol(Button.render, Decl(file.tsx, 11, 10))
34+
35+
return (<div>My Button</div>)
36+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
37+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
38+
}
39+
}
40+
41+
// OK
42+
let k1 = <div> <h2> Hello </h2> <h1> world </h1></div>;
43+
>k1 : Symbol(k1, Decl(file.tsx, 18, 3))
44+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
45+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
46+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
47+
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(file.tsx, 5, 10))
48+
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(file.tsx, 5, 10))
49+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
50+
51+
let k2 = <div> <h2> Hello </h2> {(user: any) => <h2>{user.name}</h2>}</div>;
52+
>k2 : Symbol(k2, Decl(file.tsx, 19, 3))
53+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
54+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
55+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
56+
>user : Symbol(user, Decl(file.tsx, 19, 34))
57+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
58+
>user : Symbol(user, Decl(file.tsx, 19, 34))
59+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
60+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
61+
62+
let k3 = <div> {1} {"That is a number"} </div>;
63+
>k3 : Symbol(k3, Decl(file.tsx, 20, 3))
64+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
65+
>div : Symbol(JSX.IntrinsicElements.div, Decl(file.tsx, 3, 30))
66+
67+
let k4 = <Button> <h2> Hello </h2> </Button>;
68+
>k4 : Symbol(k4, Decl(file.tsx, 21, 3))
69+
>Button : Symbol(Button, Decl(file.tsx, 8, 1))
70+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
71+
>h2 : Symbol(JSX.IntrinsicElements.h2, Decl(file.tsx, 4, 11))
72+
>Button : Symbol(Button, Decl(file.tsx, 8, 1))
73+

0 commit comments

Comments
 (0)