Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Closure Compiler addes "use strict" to result file when --language_out is set to ECMASCRIPT_2015

Google Closure Compiler addes "use strict" to result file when --language_out is set to ECMASCRIPT_2015

For some unknown reason, when setting the "--language_out ECMASCRIPT_2015" param, the program forces the use of strict mode and adds “use strict” at the beginning of the result file.

Neither "--jscomp_off es5Strict" no any undocumented params help. It looks like GCC in ECMASCRIPT_2015-compatible mode uses "strict mode" as default.

Anybody knows how to turn it off?

I use the last GCC version for java via bat-file command:

java -jar %USERPROFILE%\OneDrive\Portable\ClosureCompiler\cc.jar --js %1.%2 --js_output_file %1.min.%2 --language_in ECMASCRIPT_2015 --language_out ECMASCRIPT_2015 --jscomp_off es5Strict
like image 607
Nisbor Avatar asked Oct 15 '25 13:10

Nisbor


1 Answers

There is now an option for this, --emit_use_strict=false

like image 56
Alon Zakai Avatar answered Oct 18 '25 08:10

Alon Zakai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!