Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google closure compiler 隐藏谷歌图书馆';s警告_Google Closure Compiler_Google Closure Library - Fatal编程技术网

Google closure compiler 隐藏谷歌图书馆';s警告

Google closure compiler 隐藏谷歌图书馆';s警告,google-closure-compiler,google-closure-library,Google Closure Compiler,Google Closure Library,我在我的项目中使用Google Close和Google Library,我遇到了警告问题 我的项目由大约50个文件组成,带有一些小警告(JSDoc错误)。问题是谷歌库,当我编译我的项目时,谷歌库中出现了大量警告,如下所示: ../Libs/Closure/closure/goog/uri/utils.js:255: WARNING - inconsistent return type found : (null|string|undefined) required: (null|strin

我在我的项目中使用Google Close和Google Library,我遇到了警告问题

我的项目由大约50个文件组成,带有一些小警告(JSDoc错误)。问题是谷歌库,当我编译我的项目时,谷歌库中出现了大量警告,如下所示:

../Libs/Closure/closure/goog/uri/utils.js:255: WARNING - inconsistent return type
found   : (null|string|undefined)
required: (null|string)
  return uri && decodeURIComponent(uri);
         ^

../Libs/Closure/closure/goog/uri/utils.js:634: WARNING - inconsistent return type
found   : (Array.<(string|undefined)>|undefined)
required: Array.<(string|undefined)>
  return buffer;
         ^

../Libs/Closure/closure/goog/uri/utils.js:671: WARNING - inconsistent return type
found   : (Array.<(string|undefined)>|undefined)
required: Array.<(string|undefined)>
  return buffer;
         ^

../Libs/Closure/third_party/closure/goog/mochikit/async/deferred.js:623: WARNING - assignment to property deferred of goog.async.Deferred.AlreadyCalledError
found   : (goog.async.Deferred|undefined)
required: (goog.async.Deferred|null)
  this.deferred = deferred;
  ^

../Libs/Closure/third_party/closure/goog/mochikit/async/deferred.js:651: WARNING - assignment to property deferred of goog.async.Deferred.CancelledError
found   : (goog.async.Deferred|undefined)
required: (goog.async.Deferred|null)
  this.deferred = deferred;
  ^

谢谢你的时间

您可以在文件概览中使用@suppress标记。

要禁止显示所有警告消息,应使用:

--compiler\u flags=“--warning\u level=QUIET”

而不是当前的
verbose
设置


您可能还想检查插件是否使用闭包的工具(如生成器、编译器和depswitter)实现自动化。

另一种方法是使用
--warnings\u whitelist\u file
。尽管如此,要让它按预期工作还是有点棘手。详情如下:

../Libs/Closure/closure/bin/build/closurebuilder.py \
--root=../Libs/Closure/ \
--root=../Projects/myProject/ \
--namespace="Project" \
--output_mode=compiled \
--compiler_jar=../Libs/Closure/compiler.jar \
--compiler_flags="--third_party=../Libs/Raphael/raphaeljs_extern.js" \
--compiler_flags="--compilation_level=SIMPLE_OPTIMIZATIONS" \
--compiler_flags="--warning_level=VERBOSE" \
> ../../Projects/js/project_release.js