-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(7410): allow using JSXElement as JSXAttributeValue
- Loading branch information
1 parent
2d85e1e
commit ae39c08
Showing
24 changed files
with
266 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/baselines/reference/jsxAttributeInitializer(jsx=preserve).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
tests/cases/conformance/jsx/a.tsx(7,16): error TS1145: '{' or JSX element expected. | ||
|
||
|
||
==== tests/cases/conformance/jsx/a.tsx (1 errors) ==== | ||
declare var React: any; | ||
|
||
<div> | ||
<div attr=<div /> /> | ||
<div attr=<div>foo</div> /> | ||
<div attr=<><div>foo</div></> /> | ||
<div attr= /> | ||
~ | ||
!!! error TS1145: '{' or JSX element expected. | ||
</div> | ||
|
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/jsxAttributeInitializer(jsx=preserve).js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//// [a.tsx] | ||
declare var React: any; | ||
|
||
<div> | ||
<div attr=<div /> /> | ||
<div attr=<div>foo</div> /> | ||
<div attr=<><div>foo</div></> /> | ||
<div attr= /> | ||
</div> | ||
|
||
|
||
//// [a.jsx] | ||
<div> | ||
<div attr=<div />/> | ||
<div attr=<div>foo</div>/> | ||
<div attr=<><div>foo</div></>/> | ||
<div attr/> | ||
</div>; |
19 changes: 19 additions & 0 deletions
19
tests/baselines/reference/jsxAttributeInitializer(jsx=preserve).symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
=== tests/cases/conformance/jsx/a.tsx === | ||
declare var React: any; | ||
>React : Symbol(React, Decl(a.tsx, 0, 11)) | ||
|
||
<div> | ||
<div attr=<div /> /> | ||
>attr : Symbol(attr, Decl(a.tsx, 3, 8)) | ||
|
||
<div attr=<div>foo</div> /> | ||
>attr : Symbol(attr, Decl(a.tsx, 4, 8)) | ||
|
||
<div attr=<><div>foo</div></> /> | ||
>attr : Symbol(attr, Decl(a.tsx, 5, 8)) | ||
|
||
<div attr= /> | ||
>attr : Symbol(attr, Decl(a.tsx, 6, 8)) | ||
|
||
</div> | ||
|
40 changes: 40 additions & 0 deletions
40
tests/baselines/reference/jsxAttributeInitializer(jsx=preserve).types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
=== tests/cases/conformance/jsx/a.tsx === | ||
declare var React: any; | ||
>React : any | ||
|
||
<div> | ||
><div> <div attr=<div /> /> <div attr=<div>foo</div> /> <div attr=<><div>foo</div></> /> <div attr= /></div> : any | ||
>div : any | ||
|
||
<div attr=<div /> /> | ||
><div attr=<div /> /> : any | ||
>div : any | ||
>attr : any | ||
><div /> : any | ||
>div : any | ||
|
||
<div attr=<div>foo</div> /> | ||
><div attr=<div>foo</div> /> : any | ||
>div : any | ||
>attr : any | ||
><div>foo</div> : any | ||
>div : any | ||
>div : any | ||
|
||
<div attr=<><div>foo</div></> /> | ||
><div attr=<><div>foo</div></> /> : any | ||
>div : any | ||
>attr : any | ||
><><div>foo</div></> : any | ||
><div>foo</div> : any | ||
>div : any | ||
>div : any | ||
|
||
<div attr= /> | ||
><div attr= /> : any | ||
>div : any | ||
>attr : true | ||
|
||
</div> | ||
>div : any | ||
|
15 changes: 15 additions & 0 deletions
15
tests/baselines/reference/jsxAttributeInitializer(jsx=react).errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
tests/cases/conformance/jsx/a.tsx(7,16): error TS1145: '{' or JSX element expected. | ||
|
||
|
||
==== tests/cases/conformance/jsx/a.tsx (1 errors) ==== | ||
declare var React: any; | ||
|
||
<div> | ||
<div attr=<div /> /> | ||
<div attr=<div>foo</div> /> | ||
<div attr=<><div>foo</div></> /> | ||
<div attr= /> | ||
~ | ||
!!! error TS1145: '{' or JSX element expected. | ||
</div> | ||
|
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/jsxAttributeInitializer(jsx=react).js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//// [a.tsx] | ||
declare var React: any; | ||
|
||
<div> | ||
<div attr=<div /> /> | ||
<div attr=<div>foo</div> /> | ||
<div attr=<><div>foo</div></> /> | ||
<div attr= /> | ||
</div> | ||
|
||
|
||
//// [a.js] | ||
React.createElement("div", null, | ||
React.createElement("div", { attr: React.createElement("div", null) }), | ||
React.createElement("div", { attr: React.createElement("div", null, "foo") }), | ||
React.createElement("div", { attr: React.createElement(React.Fragment, null, | ||
React.createElement("div", null, "foo")) }), | ||
React.createElement("div", { attr: true })); |
19 changes: 19 additions & 0 deletions
19
tests/baselines/reference/jsxAttributeInitializer(jsx=react).symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
=== tests/cases/conformance/jsx/a.tsx === | ||
declare var React: any; | ||
>React : Symbol(React, Decl(a.tsx, 0, 11)) | ||
|
||
<div> | ||
<div attr=<div /> /> | ||
>attr : Symbol(attr, Decl(a.tsx, 3, 8)) | ||
|
||
<div attr=<div>foo</div> /> | ||
>attr : Symbol(attr, Decl(a.tsx, 4, 8)) | ||
|
||
<div attr=<><div>foo</div></> /> | ||
>attr : Symbol(attr, Decl(a.tsx, 5, 8)) | ||
|
||
<div attr= /> | ||
>attr : Symbol(attr, Decl(a.tsx, 6, 8)) | ||
|
||
</div> | ||
|
40 changes: 40 additions & 0 deletions
40
tests/baselines/reference/jsxAttributeInitializer(jsx=react).types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
=== tests/cases/conformance/jsx/a.tsx === | ||
declare var React: any; | ||
>React : any | ||
|
||
<div> | ||
><div> <div attr=<div /> /> <div attr=<div>foo</div> /> <div attr=<><div>foo</div></> /> <div attr= /></div> : any | ||
>div : any | ||
|
||
<div attr=<div /> /> | ||
><div attr=<div /> /> : any | ||
>div : any | ||
>attr : any | ||
><div /> : any | ||
>div : any | ||
|
||
<div attr=<div>foo</div> /> | ||
><div attr=<div>foo</div> /> : any | ||
>div : any | ||
>attr : any | ||
><div>foo</div> : any | ||
>div : any | ||
>div : any | ||
|
||
<div attr=<><div>foo</div></> /> | ||
><div attr=<><div>foo</div></> /> : any | ||
>div : any | ||
>attr : any | ||
><><div>foo</div></> : any | ||
><div>foo</div> : any | ||
>div : any | ||
>div : any | ||
|
||
<div attr= /> | ||
><div attr= /> : any | ||
>div : any | ||
>attr : true | ||
|
||
</div> | ||
>div : any | ||
|
Oops, something went wrong.