Closure Compiler - {SyntheticVarsDeclar}: WARNING - Redeclared variable

女生的网名这么多〃 提交于 2019-12-22 18:37:22

问题


I am using Closure Compiler with --warning_level=VERBOSE and --compilation_level ADVANCED_OPTIMIZATIONS

It outputs:

{SyntheticVarsDeclar}: WARNING - Redeclared variable: i
0 error(s), 1 warning(s)

Is there a way to find out more information about where this i variable is declared?

//Update

I have run through every i variable in all the files and there is none that are redeclared.

Here is a list of flags being used:

--jscomp_off=externsValidation

--summary_detail_level=3

--warning_level=VERBOSE

--externs

--compilation_level ADVANCED_OPTIMIZATIONS

--output_wrapper

--source_map_format

--js_output_file

//Update 2

I am using the latest Closure Compiler from: http://dl.google.com/closure-compiler/compiler-latest.zip

When I add a "var i" at the top of the first file, the compiler comes back with:

firstFile.js:1: WARNING - Redeclared variable: i
var i;
    ^

and there is no previous {SyntheticVarsDeclar} warning.


回答1:


Verify that the --third_party flag is not being used. Nothing should be added as {SyntheticVarsDeclar} unless the declaration is missing. The --third_party flag cause missing global variables declarations to be "declared" in "{SyntheticVarsDeclar}".



来源:https://stackoverflow.com/questions/21057870/closure-compiler-syntheticvarsdeclar-warning-redeclared-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!