【发布时间】:2011-05-26 16:04:46
【问题描述】:
如果你正在使用模块模式并且有这样的东西:
(function () {
"use strict";
// this function is strict...
}());
并使用 Google Closure Compiler 编译代码,"use strict"; 指令不会使其进入编译文件。
那么如何防止闭包编译器删除 ES5/strict 指令?
(请注意,我不想使用强制ES5/strict模式的其他模式,即简单地将“use strict”;添加到编译文件的第一行。我想使用模块模式如here所述。)
【问题讨论】:
标签: javascript google-closure google-closure-compiler ecmascript-5