How to force google closure compiler to keep “use strict”; in the compiled js code?

后端 未结 5 1063
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-24 12:07

If you\'re using the module pattern and have something like this:

(function () {
   \"use strict\";
   // this function is strict...
}());

5条回答
  •  死守一世寂寞
    2020-12-24 12:53

    Strict mode is useful for debugging, and not much else until it sees adoption into every major browser. By the time Closure Compiler removes the tag it's era of being useful is over anyway. I'm sure they'll update the compiler to allow preserving the tag long before that feature will actually be useful.

提交回复
热议问题