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

Destructuring in named export from a function call is transpiled incorrectly #845

Open
janmeier opened this issue Oct 11, 2024 · 0 comments · May be fixed by #829
Open

Destructuring in named export from a function call is transpiled incorrectly #845

janmeier opened this issue Oct 11, 2024 · 0 comments · May be fixed by #829

Comments

@janmeier
Copy link
Contributor

Suppose I have a function that returns an object. I call the function, and destructure the returned object, to export some of the properties:

https://sucrase.io/#compressedCode=H4sIAFEXCWcAA02OQQrDMAwE73rF3pJAX1DoMQ9xXKUNpFKRZVJa%2FPc47iW6LezMKqokxxS%2BuGHOEn1RQT%2FgB0I9Y88mNU3BrnDLjEKFKDZsVj1hB9Ugf5puEN4wmqn13dFbEmJYV753FwR75BeLp6G6%2BPNWc%2FyNbQilWutLtAMzFIeLnQAAAA%3D%3D

The destructuring is wrapped in a parenthesis, but it should be prefixed with a semicolon, otherwise we end up calling the statement on the previous line

With sucrase I get an error foo is called (foo is the function on the previous line), with babel and tsc I don't

@magic-akari magic-akari linked a pull request Nov 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant