Closure Compiler - {SyntheticVarsDeclar}: WARNING

2019-05-18 20:09发布

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条回答
等我变得足够好
2楼-- · 2019-05-18 20:20

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}".

查看更多
登录 后发表回答