Disable JSX recovery hack when in unary expression context#53666
Disable JSX recovery hack when in unary expression context#53666jakebailey merged 2 commits intomicrosoft:mainfrom
Conversation
DanielRosenwasser
left a comment
There was a problem hiding this comment.
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.
DanielRosenwasser
left a comment
There was a problem hiding this comment.
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 <[email protected]>
…to release-5.0 (microsoft#53676) Co-authored-by: Jake Bailey <[email protected]>
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.