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

Compiler errors with paranthesised functions #14595

Open
Ocean-OS opened this issue Dec 6, 2024 · 2 comments
Open

Compiler errors with paranthesised functions #14595

Ocean-OS opened this issue Dec 6, 2024 · 2 comments

Comments

@Ocean-OS
Copy link
Contributor

Ocean-OS commented Dec 6, 2024

Describe the bug

If you place a paranthesised function on a line after a non paranthesised function, you get a compiler error that claims that your code is not JavaScript and that an identifier was expected.

Reproduction

Reproduction

Logs

No response

System Info

N/A

Severity

annoyance

@Rich-Harris
Copy link
Member

This is a bug (in esrap — we're not wrapping a FunctionExpression in parens if it's a direct child of an ExpressionStatement) — but I'm very curious about how you ended up here in the first place. That code doesn't... do anything?

@Ocean-OS
Copy link
Contributor Author

Ocean-OS commented Dec 6, 2024

I'm very curious about how you ended up here in the first place. That code doesn't... do anything?

I was looking for other bugs and stumbled upon this one. Some of the other possible bugs I was testing were to see if the compiler would insert unnecessary $.gets in closures, and if the state symbol would appear in $state proxies.

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

No branches or pull requests

2 participants