CoffeeScript 1.4.0 发布

CoffeeScript 1.4 发布了,该版本没有太多值得兴奋的,除非你是在 Node.js 之上使用而且厌倦了那些警告信息。你可以通过 GitHub compare view 来比较两个版本(1.3.3)的不同。

官网上有关于 1.4.0 的详细改进记录,主要有:

  • The CoffeeScript compiler now strips Microsoft's UTF-8 BOM if it exists, allowing you to compile BOM-borked source files.
  • Fix Node/compiler deprecation warnings by removing registerExtension, and moving from path.exists to fs.exists.
  • Small tweaks to splat compilation, backticks, slicing, and the error for duplicate keys in object literals.

CoffeeScript (GitHub repo) 是一个使用纯Ruby编写的新编程语言,创建者 Jeremy Ashkenas戏称它是- JavaScript的不那么铺张(买弄)的小兄弟。因为CoffeeScript会将Ruby编译成JavaScript,而且大部分结构都相似,但不 同的是,CoffeeScript拥有更严格的语法。

先来看下对比代码(左为CoffeeScript):

posted @ 2012-10-26 14:51  ChaunceyHao  阅读(173)  评论(0)    收藏  举报