-
Notifications
You must be signed in to change notification settings - Fork 12.9k
JSX and as
operator
#3564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
JSX and as
operator
#3564
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
556cb70
Utilities + types setup for JSX and As
RyanCavanaugh a4045e5
Scanner / parser for JSX and As
RyanCavanaugh 6dfe3d7
JSX/as support in tsc.js + error messages
RyanCavanaugh 195db03
Checker work for JSX + As
RyanCavanaugh f5336db
Emitter for JSX
RyanCavanaugh 6d01a44
Formatting and LS for JSX and As
RyanCavanaugh e34d8cd
Test support for TSX files
RyanCavanaugh fa198a5
Fourslash tests for JSX and As
RyanCavanaugh 2b44dca
Conformance tests for 'as' operator
RyanCavanaugh bc9b53a
Conformance tests for JSX
RyanCavanaugh a5c44a3
Baseline-accept
RyanCavanaugh
8000
Jun 18, 2015
46eb521
Missed a few files in baseline-accept
RyanCavanaugh b0750c2
Fix emit for boolean attributes
RyanCavanaugh 388e73f
Fix React emit for spread attributes when they are the first attribute
RyanCavanaugh 2555344
Misc cleanup
RyanCavanaugh e448d8b
Treat </ as a token in TSX files
RyanCavanaugh c9a925e
Unrelated baseline noise
RyanCavanaugh 16c8344
More cleanup
RyanCavanaugh 5bc10b9
It's no longer safe to store JSX elem. attr. type in nodelinks.resolv…
RyanCavanaugh b3ca009
Merge remote-tracking branch 'upstream/master' into jsxAndAs
RyanCavanaugh 65828c4
Spreaded anys should satisfy all required properties
RyanCavanaugh 8180b7d
Don't error on JSX elements when JSX.Element isn't present
RyanCavanaugh b1a05b8
Improve commandline help for --jsx
RyanCavanaugh 306de4d
CR feedback
RyanCavanaugh ce6f39e
Move token scan to inside `if`
RyanCavanaugh 042f1fc
Update for style :tophat:
RyanCavanaugh 634d35a
Merge remote-tracking branch 'upstream/master' into jsxAndAs
RyanCavanaugh 1d09c6e
Don't use ES5 array APIs
RyanCavanaugh 3402f35
Missed a file in merge; use Tristate.True in arrow fn check
RyanCavanaugh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix React emit for spread attributes when they are the first attribute
- Loading branch information
commit 388e73f49f9857f2ae2783af0d0812ed83952ad1
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -1178,6 +1178,11 @@ var __param = (this && this.__param) || function (paramIndex, decorator) { | |
let haveOpenedObjectLiteral = false; | ||
for (var i = 0; i < attrs.length; i++) { | ||
if (attrs[i].kind === SyntaxKind.JsxSpreadAttribute) { | ||
// If this is the first argument, we need to emit a {} as the first argument | ||
if(i === 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Space after There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe t 10000 his comment to others. Learn more. ✔️ |
||
write('{}, '); | ||
} | ||
|
||
if (haveOpenedObjectLiteral) { | ||
write('}'); | ||
haveOpenedObjectLiteral = false; | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
let
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️