闭包编译器-{SyntheticVarsDeclar}:警告-重新声明的变量 [英] Closure Compiler - {SyntheticVarsDeclar}: WARNING - Redeclared variable
问题描述
我正在使用--warning_level=VERBOSE
和--compilation_level ADVANCED_OPTIMIZATIONS
它输出:
{SyntheticVarsDeclar}: WARNING - Redeclared variable: i
0 error(s), 1 warning(s)
是否可以找到有关此i
变量声明位置的更多信息?
Is there a way to find out more information about where this i
variable is declared?
//更新
我已经遍历了所有文件中的每个i
变量,没有一个被重新声明.
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
//更新2
我正在使用以下最新的Closure Compiler: http://dl.google.com/closure-compiler/compiler-latest.zip
I am using the latest Closure Compiler from: http://dl.google.com/closure-compiler/compiler-latest.zip
当我在第一个文件的顶部添加"var i"时,编译器将返回:
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;
^
,并且之前没有{SyntheticVarsDeclar}警告.
and there is no previous {SyntheticVarsDeclar} warning.
推荐答案
验证是否未使用--third_party标志.除非缺少声明,否则什么都不能添加为{SyntheticVarsDeclar}. --third_party标志导致缺少的全局变量声明在"{SyntheticVarsDeclar}"中声明".
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}".
这篇关于闭包编译器-{SyntheticVarsDeclar}:警告-重新声明的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!