-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 doesn't output synthetic code in WHITESPACE_ONLY #2007
Comments
It would also be pretty cool if |
It would also be cool if the compiler was like, hey, this for loop doesn't have side effects. I'm just going to remove it. And |
Same issue here. The "for of" loops are converted to polyfill, but the polyfill is not provided to the JS which just plain crashes. I expected Whitespace_only to not try any code modification, but it's not working at all because of this. Is there a fix planned? |
"WHITESPACE_ONLY" is used internally for systems where we are transpiling a single file at a time, and thus don't want to include the ES6 runtime library because it's going to be included once when all the files are brought together. It's a misnomer because we're not just stripping whitespace, we're also transpiling. If you don't need transpilation, you can use |
@OzoneGrif, will setting the This is a low priority issue. |
Another internal team recently encountered this, so updating the issue. At some point we want to separate |
See also this: If it isn't going to include the jscomp.* code, it shouldn't include the polyfills either as it, it is duplicating polyfill code and is still is non-functional. The compiler should produce a functional bundle at least that would be something useful. |
I'm having trouble seeing how ac3e330 fixes this issue. The commit doesn't seem to relate to the WHITESPACE_ONLY option at all. We use We are considering using a seperate tool for trasnpilation but closure compiler is already fully integrated and I capable to doing the transpilation we need. Is there some way we could fix this issue, or create a new TRANSPILE_ONLY ompilation_level? |
java -jar ~/code/compiler.jar \ --compilation_level=WHITESPACE_ONLY \ --js_output_file=/dev/stdout \ --language_in=ECMASCRIPT6_STRICT \ --language_out=ECMASCRIPT5_STRICT \ --formatting=PRETTY_PRINT \ --js lol.js
The text was updated successfully, but these errors were encountered: