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.
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
Fix right precedence of Hack pipes #13668
Fix right precedence of Hack pipes #13668
Changes from 3 commits
ad3fc0a
083e4b6
9310eec
8f26930
b984f7e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Consider hoist this object to top level so it doesn't have to be re-created in
parseHackPipeBody()
.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.
Could leave a todo item here that
invalidBodies
currently does not handle TS extensions such asTSAsExpression
, they will be supported after TypeScript supports hack pipes.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.
I added a todo, but I don't think that it will be a problem because:
a = b as c
is an AssignmentExpressiona => b as c
is an ArrowFunctionExpressiona ? b : c as d
is a ConditionalExpressionyield as a
is a syntax errorThere 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.
Oh I was meant to the plain as expression
a as c
. The precedence ofas
and|>
are unclear before TS supports pipes.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.
We can transform
invalidBodies
to a map so it comes with.has()
, and it's also faster than objects.