简体   繁体   中英

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 --externs 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM