Error when using google-closure-compiler
TeaEwan opened this issue · 4 comments
TeaEwan commented
Project url: https://github.com/google/closure-compiler
Command: google-closure-compiler --compilation_level ADVANCED --warning_level DEFAULT --js index.js --js_output_file output_index.js
An error message appears:
index.js:260:19: ERROR - [JSC_DECLARATION_NOT_DIRECTLY_IN_BLOCK] Block-scoped declaration not directly within block: Util
260| if(!Util) function Util () {};
^^^^
index.js:304:19: ERROR - [JSC_DECLARATION_NOT_DIRECTLY_IN_BLOCK] Block-scoped declaration not directly within block: Util
304| if(!Util) function Util () {};
^^^^
index.js:969:19: ERROR - [JSC_DECLARATION_NOT_DIRECTLY_IN_BLOCK] Block-scoped declaration not directly within block: Util
969| if(!Util) function Util () {};
......
How do you fix it?
claudia-romano commented
Hi there, we are removing the Util dependencies from all our components.
Meanwhile, you can replace the Util functions (e.g., Util.osHasReducedMotion()
) with a basic function (e.g. function osHasReducedMotion()
). This will fix your issue.
TeaEwan commented
Thank you for your work.
TeaEwan commented
I have noticed that some components have removed Util dependencies, some have not been removed. Will it continue?
claudia-romano commented
Yes, the dependency will be removed from all components.