开发者

CoffeeScript --bare function changed?

开发者 https://www.devze.com 2023-02-04 05:32 出处:网络
The parameter --bare in CoffeeScript has been changed. Does anyone know what new parameter开发者_JAVA百科 does the same function?By default, when coffee-script compiles a file, it wraps the result usi

The parameter --bare in CoffeeScript has been changed. Does anyone know what new parameter开发者_JAVA百科 does the same function?


By default, when coffee-script compiles a file, it wraps the result using a "self-invoking anonymous function" like so:

(function() {
  // compiled code here...
}).call(this);

You can find more reference about this here: http://2007-2010.lovemikeg.com/2008/08/17/a-week-in-javascript-patterns-self-invocation/

The --bare flags prevent this wrapping from happening.

0

精彩评论

暂无评论...
验证码 换一张
取 消