开发者

Google Closure Error with externs

I'm getting errors with Warnings like this. when I use a command line for Google Closure app. Does anyone know how to stop this. I had all Jquery code including jquery plugins set in my --exte开发者_JS百科rns like below.

java -jar compiler-latest/compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS --js deploy/js/mainMenu.js --js deploy/js/Home.js --js_output_file deploy/js/Home-min.js --externs deploy/js/jquery-1.6.1.js --externs deploy/js/jquery.backgroundPosition.js --externs deploy/js/jquery.color.js --externs deploy/js/jquery.easing.1.3.js

WARNING -

deploy/js/jquery.backgroundPosition.js:11: WARNING - accessing name name in externs has no effect
            if(name === 'background-position'){
               ^


You should generally use extern files that are written for that purpose. Such as:

http://code.google.com/p/closure-compiler/source/browse/trunk/contrib/externs/jquery-1.6.js

For definitions that is not overly dynamic (jQuery core does not fall into this category), you can use the source like you are trying to do and in that case you can silence the warnings with:

--jscomp_off=externsValidation

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜