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

A for loop compiles incorrectly in WHITESPACE_ONLY and SIMPLE_OPTIMIZATIONS #4130

Closed
jplevene opened this issue Nov 7, 2023 · 3 comments
Closed

Comments

@jplevene
Copy link

jplevene commented Nov 7, 2023

A for(const row of rows) returns $jscomp and loads of junk JavaScript code that won't run.

@jplevene
Copy link
Author

jplevene commented Nov 7, 2023

Even does this in WHITESPACE_ONLY that is not supposed to alter the code

@lauraharker
Copy link
Contributor

This is caused by transpilation. See #3856 and #2007.

Compiler versions past ac3e330 will default to not transpiling. If you're using an older version you can set --language_out=ECMASCRIPT_NEXT. If you're using a newer version, are you setting --language_out explicitly? You'd need to remove that.

@jplevene
Copy link
Author

jplevene commented Jan 9, 2024

I spotted this bug in the Google online compiler https://closure-compiler.appspot.com/ which is managed by Google so I reported this, and thanks.
By default, clicking "Whitespace only" in the online compiler should include the line // @language_out ECMASCRIPT_NEXT which is causing the issue.
Again, thanks for this and I have reported the bug there

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