Kjscompiler给出了javascript内置函数的错误(谷歌闭包编译器)

kjscompiler gives errors on javascript built-in functions (google closure compiler)

本文关键字:错误 谷歌 闭包 编译器 函数 javascript 内置 Kjscompiler      更新时间:2023-09-26

当使用kjscompiler(它使用google闭包编译器)编译时,我得到这样的错误:

Error #3: variable Date is undeclared
Error #4: variable NaN is undeclared
Error #5: variable Error is undeclared
Error #6: variable Math is undeclared

为什么?我需要添加某种依赖吗?

https://github.com/knyga/kjscompiler

听起来您没有包括默认的extern。特别是,需要es3.js的外部文件(或等效文件)。见https://github.com/google/closure-compiler/issues/477