Skip to content
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

Object literal with suffix not wrapped #1582

Closed
edemaine opened this issue Nov 5, 2024 · 0 comments
Closed

Object literal with suffix not wrapped #1582

edemaine opened this issue Nov 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@edemaine
Copy link
Collaborator

edemaine commented Nov 5, 2024

As reported by @STRd6, Civet doesn't touch this:

{} as T

But to be valid JS, it (or {}) needs to be wrapped in parens.

Likely a bug in makeExpressionStatement.

I think () => {} as T has the same issue (and is handled specially in FatArrowBody).

@edemaine edemaine added the bug Something isn't working label Nov 5, 2024
edemaine added a commit that referenced this issue Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant