javascriptgoogle-closure-compiler

google closure compiler - double compilation


I finally got to the point where my javascript code compiles in the google closure compiler without any errors or warnings. Now I want to recompile the code generated and when I paste that code back into the compiler, I get over 100 warnings: most of them are JSC_REDECLARED_VARIABLE and a few JSC_INEXISTENT_PROPERTY.

Why is that?

enter image description here


Solution

  • I do not think the Google Closure Compiler produces code that is intended for further compilation.

    To have code compile correctly you have to keep some structure. But that extra structure is among the things removed by the compiler and without it the compiler cannot correctly interpret the code.

    You should be able to do the easier modes of compilation but not the advanced one.