Google 闭包编译器错误“变量已在 {SyntheticVarsDeclar} 中首先声明”

发布于 2024-08-10 13:59:49 字数 428 浏览 3 评论 0 原文

当使用 Google 闭包编译器尝试编译从其 编辑器演示(无外部代码)使用 calcdeps.py 然后在生成的代码上运行编译器(运行良好)时出现以下错误:

 {SyntheticVarsDeclar}: ERROR - Variable COMPILED first declared in {SyntheticVarsDeclar}

变量 COMPILED 仅在计算依赖项生成的文件中的 2 个位置使用,并且未在其中的任何位置声明。我看到它声明的唯一地方是在 base.js 中。

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 dependencies produces and isn't declared anywhere in there. The only place I see it declared is in base.js.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

败给现实 2024-08-17 13:59:49

这曾经是闭包编译器中的一个错误。显然它已经被修复了。您应该下载当前版本的闭包编译器。

对此有一个已关闭的错误报告闭包编译器问题跟踪器中的问题。

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.

旧时光的容颜 2024-08-17 13:59:49

尝试在开头声明它并使用此标签 像这样:

/**
* @define {boolean} Overridden to true by the compiler when --closure_pass
*                   or --mark_as_compiled is specified.
*/
var COMPILED = false;

我几乎确定它会解决问题,事实上我什至认为你不需要标签。还可以尝试下载最新的编译器或从 svn 编译它,因为有可疑之前报告过类似的错误并已修复。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文