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
Disable JSX recovery hack when in unary expression context #53666
Conversation
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 guess the fix here is okay - it seems overly-targeted to a specific code path though. My feeling is the right thing to do is to only do the recovery step when everything prior to the <
had no errors.
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.
also using "crash" in the test name - I'm not huge on it
If that were the implementation, then I think we'd end up crashing on this code too:
I feel like we've somewhat consistently done this:
If it were me I'd call this test case |
Duh - good point. Could you add that case though? |
Yes, will do. |
@typescript-bot cherry-pick this to release-5.0 |
Heya @jakebailey, I've started to run the task to cherry-pick this into |
Hey @jakebailey, I've opened #53676 for you. |
…e-5.0 (#53676) Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
…to release-5.0 (microsoft#53676) Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
Fixes #53114
Fixes #53637
I broke this in #52667 by adding a new call to the JSX element parser. That element parser has a unique recovery method which returns a
BinaryExpression
, but, this is incompatible with unary expressions, which cannot contain binary expressions.