question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compiler doesn't output synthetic code in WHITESPACE_ONLY

See original GitHub issue
cat lol.js
let a = [0, 1];
for (var x of a) {
}
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
'use strict';var a = [0, 1];
for (var $jscomp$iter$0 = $jscomp.makeIterator(a), $jscomp$key$x = $jscomp$iter$0.next();!$jscomp$key$x.done;$jscomp$key$x = $jscomp$iter$0.next()) {
  var x = $jscomp$key$x.value
}
;

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
concavelenzcommented, Nov 1, 2018

See also this: https://github.com/google/closure-compiler/issues/2950

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.

1reaction
brad4dcommented, Sep 28, 2017

@OzoneGrif, will setting the --language_out=ES_2017 option to avoid transpilation be sufficient for your needs? Or maybe just use SIMPLE optimization mode?

This is a low priority issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WHITESPACE_ONLY mode does non-whitespace-only ...
I think it is reasonable to expect WHITESPACE_ONLY to only do what it says and not make other adjustments which alter the way...
Read more >
Why doesn't c++ compiler output the text on the next line while ...
Space characters and newline characters are treated by the compiler differently, even though both are whitespace characters.
Read more >
Syntactically Significant Whitespace Considered Harmful
The compiler just shows a warning not a compile error, then it is just one character per source file instead of always having...
Read more >
Solved: Blank space in variable name - Intel Communities
Solved: Hello everybody, is there a compiler option that can detect blank space in a variable name ? Currently, I have following code,...
Read more >
Compiler Options - ClojureScript
:provides A synthetic namespace that is associated with the library. This is typically a vector with a single string, but it has the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found