Google closure compiler error "Variable COMPILED first declared in {SyntheticVarsDeclar}"
When using the Google closure compiler to try and compile a load of closure dependencies taken from their editor demo (no external code) using calcdeps.py
I get the following error when then running the compiler on the produced code (which runs fine):
{SyntheticVarsDeclar}: ERROR - Variable COMPILED first declared in {SyntheticVarsDeclar}
The variable COMPILED is only used in 2 places within the file that calculated depend开发者_运维问答encies produces and isn't declared anywhere in there. The only place I see it declared is in base.js.
This used to be a bug in the closure compiler. Apparently it has already been fixed. You should download a current version of the closure compiler.
There is a closed bug report for this issue in the closure-compiler issue tracker.
Try declaring it at the start and use this tag like this:
/**
* @define {boolean} Overridden to true by the compiler when --closure_pass
* or --mark_as_compiled is specified.
*/
var COMPILED = false;
I'm almost sure that it will fix the problem, in fact I even think that you don't need the tag. Also try downloading latest compiler or compile it from svn because there was suspiciously similar bug reported earlier and it got fixed.
精彩评论