本文介绍了为什么Closure Compiler不使用某些名称重命名对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在 http://closure-compiler.appspot.com :
// ==ClosureCompiler==
// @output_file_name default.js
// @compilation_level ADVANCED_OPTIMIZATIONS
// @formatting pretty_print
// ==/ClosureCompiler==
// These get renamed
window.foo = {};
window.bar = {};
// These don't
window.uid = {};
window.test = {};
window.a = {};
window.b = {};
window.uid = {};
window.test = {};
window.foo = {};
window.bar = {};
window.uid = {};
window.test = {};
It seems to be an issue with certain words?
推荐答案
更新
从Closure-compiler的20150315版本开始,默认情况下启用基于类型的优化.
Update
As of the 20150315 release of Closure-compiler, the type based optimizations are enabled by default.
Closure Compiler不会重命名与外部对象中定义的任何属性同名的属性,除非启用了--use_types_for_optimization
标志.参见项目常见问题解答以获取更多详细信息.
Closure Compiler will not rename properties that have the same name as any property defined on an object in the externs unless the --use_types_for_optimization
flag is enabled. See the project FAQ for more details.
这篇关于为什么Closure Compiler不使用某些名称重命名对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!