gpt4 book ai didi

javascript - 当 --language_out 设置为 ECMASCRIPT_2015 时,Google Closure Compiler 将 "use strict"添加到结果文件中

转载 作者:行者123 更新时间:2023-12-04 04:22:48 26 4
gpt4 key购买 nike

当 --language_out 设置为 ECMASCRIPT_2015 时,Google Closure Compiler 向结果文件添加“use strict”

由于某种未知的原因,在设置“--language_out ECMASCRIPT_2015”参数时,程序强制使用严格模式并在结果文件的开头添加“use strict”。

“--jscomp_off es5Strict”和任何未记录的参数都没有帮助。看起来 ECMASCRIPT_2015 兼容模式下的 GCC 默认使用“严格模式”。

有人知道怎么关掉吗?

我通过 bat-file 命令使用 Java 的最新 GCC 版本:

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

最佳答案

现在有一个选项,--emit_use_strict=false

关于javascript - 当 --language_out 设置为 ECMASCRIPT_2015 时,Google Closure Compiler 将 "use strict"添加到结果文件中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58681722/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com