File: checkJsxChildrenProperty14.symbols

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (134 lines) | stat: -rw-r--r-- 5,166 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
=== tests/cases/conformance/jsx/file.tsx ===
import React = require('react');
>React : Symbol(React, Decl(file.tsx, 0, 0))

interface Prop {
>Prop : Symbol(Prop, Decl(file.tsx, 0, 32))

    a: number,
>a : Symbol(Prop.a, Decl(file.tsx, 2, 16))

    b: string,
>b : Symbol(Prop.b, Decl(file.tsx, 3, 14))

    children: JSX.Element | JSX.Element[];
>children : Symbol(Prop.children, Decl(file.tsx, 4, 14))
>JSX : Symbol(JSX, Decl(react.d.ts, 2353, 1))
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2356, 27))
>JSX : Symbol(JSX, Decl(react.d.ts, 2353, 1))
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2356, 27))
}

class Button extends React.Component<any, any> {
>Button : Symbol(Button, Decl(file.tsx, 6, 1))
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
>React : Symbol(React, Decl(file.tsx, 0, 0))
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))

    render() {
>render : Symbol(Button.render, Decl(file.tsx, 8, 48))

        return (<div>My Button</div>)
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
    }
}

function AnotherButton(p: any) {
>AnotherButton : Symbol(AnotherButton, Decl(file.tsx, 12, 1))
>p : Symbol(p, Decl(file.tsx, 14, 23))

    return <h1>Just Another Button</h1>;
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
>h1 : Symbol(JSX.IntrinsicElements.h1, Decl(react.d.ts, 2410, 47))
}

function Comp(p: Prop) {
>Comp : Symbol(Comp, Decl(file.tsx, 16, 1))
>p : Symbol(p, Decl(file.tsx, 18, 14))
>Prop : Symbol(Prop, Decl(file.tsx, 0, 32))

    return <div>{p.b}</div>;
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
>p.b : Symbol(Prop.b, Decl(file.tsx, 3, 14))
>p : Symbol(p, Decl(file.tsx, 18, 14))
>b : Symbol(Prop.b, Decl(file.tsx, 3, 14))
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
}

// OK
let k1 = <Comp a={10} b="hi"><></><Button /><AnotherButton /></Comp>;
>k1 : Symbol(k1, Decl(file.tsx, 23, 3))
>Comp : Symbol(Comp, Decl(file.tsx, 16, 1))
>a : Symbol(a, Decl(file.tsx, 23, 14))
>b : Symbol(b, Decl(file.tsx, 23, 21))
>Button : Symbol(Button, Decl(file.tsx, 6, 1))
>AnotherButton : Symbol(AnotherButton, Decl(file.tsx, 12, 1))
>Comp : Symbol(Comp, Decl(file.tsx, 16, 1))

let k2 = <Comp a={10} b="hi"><><Button /></><AnotherButton /></Comp>;
>k2 : Symbol(k2, Decl(file.tsx, 24, 3))
>Comp : Symbol(Comp, Decl(file.tsx, 16, 1))
>a : Symbol(a, Decl(file.tsx, 24, 14))
>b : Symbol(b, Decl(file.tsx, 24, 21))
>Button : Symbol(Button, Decl(file.tsx, 6, 1))
>AnotherButton : Symbol(AnotherButton, Decl(file.tsx, 12, 1))
>Comp : Symbol(Comp, Decl(file.tsx, 16, 1))

let k3 = <Comp a={10} b="hi"><><Button /><AnotherButton /></></Comp>;
>k3 : Symbol(k3, Decl(file.tsx, 25, 3))
>Comp : Symbol(Comp, Decl(file.tsx, 16, 1))
>a : Symbol(a, Decl(file.tsx, 25, 14))
>b : Symbol(b, Decl(file.tsx, 25, 21))
>Button : Symbol(Button, Decl(file.tsx, 6, 1))
>AnotherButton : Symbol(AnotherButton, Decl(file.tsx, 12, 1))
>Comp : Symbol(Comp, Decl(file.tsx, 16, 1))

interface SingleChildProp {
>SingleChildProp : Symbol(SingleChildProp, Decl(file.tsx, 25, 69))

    a: number,
>a : Symbol(SingleChildProp.a, Decl(file.tsx, 27, 27))

    b: string,
>b : Symbol(SingleChildProp.b, Decl(file.tsx, 28, 14))

    children: JSX.Element;
>children : Symbol(SingleChildProp.children, Decl(file.tsx, 29, 14))
>JSX : Symbol(JSX, Decl(react.d.ts, 2353, 1))
>Element : Symbol(JSX.Element, Decl(react.d.ts, 2356, 27))
}

function SingleChildComp(p: SingleChildProp) {
>SingleChildComp : Symbol(SingleChildComp, Decl(file.tsx, 31, 1))
>p : Symbol(p, Decl(file.tsx, 33, 25))
>SingleChildProp : Symbol(SingleChildProp, Decl(file.tsx, 25, 69))

    return <div>{p.b}</div>;
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
>p.b : Symbol(SingleChildProp.b, Decl(file.tsx, 28, 14))
>p : Symbol(p, Decl(file.tsx, 33, 25))
>b : Symbol(SingleChildProp.b, Decl(file.tsx, 28, 14))
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
}

// OK
let k4 = <SingleChildComp a={10} b="hi"><><Button /><AnotherButton /></></SingleChildComp>;
>k4 : Symbol(k4, Decl(file.tsx, 38, 3))
>SingleChildComp : Symbol(SingleChildComp, Decl(file.tsx, 31, 1))
>a : Symbol(a, Decl(file.tsx, 38, 25))
>b : Symbol(b, Decl(file.tsx, 38, 32))
>Button : Symbol(Button, Decl(file.tsx, 6, 1))
>AnotherButton : Symbol(AnotherButton, Decl(file.tsx, 12, 1))
>SingleChildComp : Symbol(SingleChildComp, Decl(file.tsx, 31, 1))

// Error
let k5 = <SingleChildComp a={10} b="hi"><></><Button /><AnotherButton /></SingleChildComp>;
>k5 : Symbol(k5, Decl(file.tsx, 41, 3))
>SingleChildComp : Symbol(SingleChildComp, Decl(file.tsx, 31, 1))
>a : Symbol(a, Decl(file.tsx, 41, 25))
>b : Symbol(b, Decl(file.tsx, 41, 32))
>Button : Symbol(Button, Decl(file.tsx, 6, 1))
>AnotherButton : Symbol(AnotherButton, Decl(file.tsx, 12, 1))
>SingleChildComp : Symbol(SingleChildComp, Decl(file.tsx, 31, 1))