Skip to content

Commit 13167f5

Browse files
committed
Don't ever use resolveEntityName here
1 parent 48c5bcf commit 13167f5

12 files changed

+8
-65
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8481,7 +8481,7 @@ namespace ts {
84818481
return getIntrinsicTagSymbol(node);
84828482
}
84838483
else {
8484-
return resolveEntityName(node.tagName, SymbolFlags.Value);
8484+
return checkExpression(node.tagName).symbol;
84858485
}
84868486
}
84878487

tests/baselines/reference/jsxEsprimaFbTestSuite.errors.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(39,29): error TS1005: '{'
44
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(39,57): error TS1109: Expression expected.
55
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(39,58): error TS1109: Expression expected.
66
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(41,1): error TS1003: Identifier expected.
7-
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(41,8): error TS2503: Cannot find namespace 'a'.
87
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(41,12): error TS2657: JSX expressions must have one parent element
9-
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(43,10): error TS2503: Cannot find namespace 'a'.
108

119

12-
==== tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx (9 errors) ====
10+
==== tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx (7 errors) ====
1311
declare var React: any;
1412
declare var 日本語;
1513
declare var AbC_def;
@@ -63,14 +61,10 @@ tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(43,10): error TS2503: Cann
6361
<a.b></a.b>;
6462
~
6563
!!! error TS1003: Identifier expected.
66-
~
67-
!!! error TS2503: Cannot find namespace 'a'.
6864
~
6965
!!! error TS2657: JSX expressions must have one parent element
7066

7167
<a.b.c></a.b.c>;
72-
~
73-
!!! error TS2503: Cannot find namespace 'a'.
7468

7569
(<div />) < x;
7670

tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,12): error TS2304:
2424
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(11,16): error TS1109: Expression expected.
2525
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,2): error TS2304: Cannot find name 'a'.
2626
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,5): error TS1003: Identifier expected.
27-
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,10): error TS2503: Cannot find namespace 'a'.
27+
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,10): error TS2304: Cannot find name 'a'.
2828
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,13): error TS1005: '>' expected.
2929
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,14): error TS2304: Cannot find name 'c'.
3030
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(12,16): error TS1109: Expression expected.
@@ -38,7 +38,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,8): error TS2304:
3838
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(14,10): error TS1109: Expression expected.
3939
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,2): error TS2304: Cannot find name 'a'.
4040
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,4): error TS1003: Identifier expected.
41-
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,7): error TS2503: Cannot find namespace 'a'.
41+
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,7): error TS2304: Cannot find name 'a'.
4242
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(15,9): error TS1003: Identifier expected.
4343
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,3): error TS1003: Identifier expected.
4444
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(16,4): error TS2304: Cannot find name 'foo'.
@@ -135,7 +135,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
135135
~
136136
!!! error TS1003: Identifier expected.
137137
~
138-
!!! error TS2503: Cannot find namespace 'a'.
138+
!!! error TS2304: Cannot find name 'a'.
139139
~
140140
!!! error TS1005: '>' expected.
141141
~
@@ -166,7 +166,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
166166
~
167167
!!! error TS1003: Identifier expected.
168168
~
169-
!!! error TS2503: Cannot find namespace 'a'.
169+
!!! error TS2304: Cannot find name 'a'.
170170
~
171171
!!! error TS1003: Identifier expected.
172172
<a[foo]></a[foo]>;

tests/baselines/reference/jsxReactTestSuite.symbols

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@ declare var hasOwnProperty:any;
5656
>div : Symbol(unknown)
5757

5858
<Component>{foo}<br />{bar}</Component>
59-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
6059
>foo : Symbol(foo, Decl(jsxReactTestSuite.tsx, 7, 11))
6160
>br : Symbol(unknown)
6261
>bar : Symbol(bar, Decl(jsxReactTestSuite.tsx, 8, 11))
63-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
6462

6563
<br />
6664
>br : Symbol(unknown)
@@ -70,20 +68,12 @@ declare var hasOwnProperty:any;
7068

7169

7270
<Composite>
73-
>Composite : Symbol(Composite, Decl(jsxReactTestSuite.tsx, 3, 11))
74-
7571
{this.props.children}
7672
</Composite>;
77-
>Composite : Symbol(Composite, Decl(jsxReactTestSuite.tsx, 3, 11))
7873

7974
<Composite>
80-
>Composite : Symbol(Composite, Decl(jsxReactTestSuite.tsx, 3, 11))
81-
8275
<Composite2 />
83-
>Composite2 : Symbol(Composite2, Decl(jsxReactTestSuite.tsx, 4, 11))
84-
8576
</Composite>;
86-
>Composite : Symbol(Composite, Decl(jsxReactTestSuite.tsx, 3, 11))
8777

8878
var x =
8979
>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
@@ -174,76 +164,62 @@ var x =
174164
>hasOwnProperty : Symbol(unknown)
175165

176166
<Component constructor="foo" />;
177-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
178167
>constructor : Symbol(unknown)
179168

180169
<Namespace.Component />;
181170

182171
<Namespace.DeepNamespace.Component />;
183172

184173
<Component { ... x } y
185-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
186174
>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
187175
>y : Symbol(unknown)
188176

189177
={2 } z />;
190178
>z : Symbol(unknown)
191179

192180
<Component
193-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
194-
195181
{...this.props} sound="moo" />;
196182
>sound : Symbol(unknown)
197183

198184
<font-face />;
199185
>font-face : Symbol(unknown)
200186

201187
<Component x={y} />;
202-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
203188
>x : Symbol(unknown)
204189
>y : Symbol(y, Decl(jsxReactTestSuite.tsx, 9, 11))
205190

206191
<x-component />;
207192
>x-component : Symbol(unknown)
208193

209194
<Component {...x} />;
210-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
211195
>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
212196

213197
<Component { ...x } y={2} />;
214-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
215198
>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
216199
>y : Symbol(unknown)
217200

218201
<Component { ... x } y={2} z />;
219-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
220202
>x : Symbol(x, Decl(jsxReactTestSuite.tsx, 10, 11), Decl(jsxReactTestSuite.tsx, 35, 3))
221203
>y : Symbol(unknown)
222204
>z : Symbol(unknown)
223205

224206
<Component x={1} {...y} />;
225-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
226207
>x : Symbol(unknown)
227208
>y : Symbol(y, Decl(jsxReactTestSuite.tsx, 9, 11))
228209

229210

230211
<Component x={1} y="2" {...z} {...z}><Child /></Component>;
231-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
232212
>x : Symbol(unknown)
233213
>y : Symbol(unknown)
234214
>z : Symbol(z, Decl(jsxReactTestSuite.tsx, 11, 11))
235215
>z : Symbol(z, Decl(jsxReactTestSuite.tsx, 11, 11))
236-
>Child : Symbol(Child, Decl(jsxReactTestSuite.tsx, 5, 11))
237-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
238216

239217
<Component x="1" {...(z = { y: 2 }, z)} z={3}>Text</Component>;
240-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
241218
>x : Symbol(unknown)
242219
>z : Symbol(z, Decl(jsxReactTestSuite.tsx, 11, 11))
243220
>y : Symbol(y, Decl(jsxReactTestSuite.tsx, 113, 27))
244221
>z : Symbol(z, Decl(jsxReactTestSuite.tsx, 11, 11))
245222
>z : Symbol(unknown)
246-
>Component : Symbol(Component, Decl(jsxReactTestSuite.tsx, 2, 11))
247223

248224

249225

tests/baselines/reference/reactNamespaceJSXEmit.symbols

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,16 @@ declare var x: any;
1717
>data : Symbol(unknown)
1818

1919
<Bar x={x} />;
20-
>Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11))
2120
>x : Symbol(unknown)
2221
>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11))
2322

2423
<x-component />;
2524
>x-component : Symbol(unknown)
2625

2726
<Bar {...x} />;
28-
>Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11))
2927
>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11))
3028

3129
<Bar { ...x } y={2} />;
32-
>Bar : Symbol(Bar, Decl(reactNamespaceJSXEmit.tsx, 3, 11))
3330
>x : Symbol(x, Decl(reactNamespaceJSXEmit.tsx, 4, 11))
3431
>y : Symbol(unknown)
3532

tests/baselines/reference/tsxExternalModuleEmit2.symbols

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ declare var Foo, React;
1818

1919
// Should see mod_1['default'] in emit here
2020
<Foo handler={Main}></Foo>;
21-
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
2221
>handler : Symbol(unknown)
2322
>Main : Symbol(Main, Decl(app.tsx, 0, 6))
24-
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
2523

2624
// Should see mod_1['default'] in emit here
2725
<Foo {...Main}></Foo>;
28-
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
2926
>Main : Symbol(Main, Decl(app.tsx, 0, 6))
30-
>Foo : Symbol(Foo, Decl(app.tsx, 1, 11))
3127

3228

tests/baselines/reference/tsxGenericArrowFunctionParsing.symbols

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ var T, T1, T2;
1515
// This is an element
1616
var x1 = <T>() => {}</T>;
1717
>x1 : Symbol(x1, Decl(file.tsx, 7, 3))
18-
>T : Symbol(T, Decl(file.tsx, 4, 3))
19-
>T : Symbol(T, Decl(file.tsx, 4, 3))
2018

2119
x1.isElement;
2220
>x1.isElement : Symbol(JSX.Element.isElement, Decl(file.tsx, 1, 20))
@@ -43,9 +41,7 @@ x3();
4341
// This is an element
4442
var x4 = <T extends={true}>() => {}</T>;
4543
>x4 : Symbol(x4, Decl(file.tsx, 19, 3))
46-
>T : Symbol(T, Decl(file.tsx, 4, 3))
4744
>extends : Symbol(unknown)
48-
>T : Symbol(T, Decl(file.tsx, 4, 3))
4945

5046
x4.isElement;
5147
>x4.isElement : Symbol(JSX.Element.isElement, Decl(file.tsx, 1, 20))
@@ -55,9 +51,7 @@ x4.isElement;
5551
// This is an element
5652
var x5 = <T extends>() => {}</T>;
5753
>x5 : Symbol(x5, Decl(file.tsx, 23, 3))
58-
>T : Symbol(T, Decl(file.tsx, 4, 3))
5954
>extends : Symbol(unknown)
60-
>T : Symbol(T, Decl(file.tsx, 4, 3))
6155

6256
x5.isElement;
6357
>x5.isElement : Symbol(JSX.Element.isElement, Decl(file.tsx, 1, 20))

tests/baselines/reference/tsxOpeningClosingNames.symbols

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ declare module A.B.C {
1616
}
1717

1818
<A.B.C.D>foo</A . B . C.D>
19-
>D : Symbol(A.B.C.D, Decl(file.tsx, 5, 5))
20-
>D : Symbol(A.B.C.D, Decl(file.tsx, 5, 5))
2119

tests/baselines/reference/tsxPreserveEmit1.symbols

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import Route = ReactRouter.Route;
1313

1414
var routes1 = <Route />;
1515
>routes1 : Symbol(routes1, Decl(test.tsx, 6, 3))
16-
>Route : Symbol(ReactRouter.Route, Decl(react.d.ts, 7, 4))
1716

1817
module M {
1918
>M : Symbol(M, Decl(test.tsx, 6, 24), Decl(test.tsx, 10, 1))
@@ -27,8 +26,6 @@ module M {
2726
// Should emit 'M.X' in both opening and closing tags
2827
var y = <X></X>;
2928
>y : Symbol(y, Decl(test.tsx, 13, 4))
30-
>X : Symbol(X, Decl(test.tsx, 9, 11))
31-
>X : Symbol(X, Decl(test.tsx, 9, 11))
3229
}
3330

3431
=== tests/cases/conformance/jsx/react.d.ts ===

tests/baselines/reference/tsxPreserveEmit2.symbols

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ var Route: any;
66

77
var routes1 = <Route />;
88
>routes1 : Symbol(routes1, Decl(test.tsx, 3, 3))
9-
>Route : Symbol(Route, Decl(test.tsx, 2, 3))
109

0 commit comments

Comments
 (0)