sky 发表于 2015-3-5 03:32:34

Esprima 2.0 发布,支持 ES6 特性

3月21日 深圳 OSC 源创会开始报名罗,送华为海思开发板
  Esprima 2.0 发布,此版本现已提供在 npm。直到现在官方的 Esprima 仅仅支持 ECMAScript 5 标准语法解析。但是试验分支“harmony” 添加了 ECMAScript 2015 (也就是非常流行的 ES6) 特性,主要是由 Facebook 驱动的。现在大量的 ES6 特性已经趋于稳定,而且在一些浏览器中使用,那么就需要工具来支持新的语法。
  Esprima 2.0 引入大量稳定的 ES6 特性,可以进行代码覆盖分析,style checkers 等功能。

  Esprima 1.x 将会继续维护,但是只提供 ES5 特性支持。
  Esprima 2.1 将会尽快发布,Esprima 2.0 更新日志:
  * Support ES6 arrow function (issue 517)
* Support ES6 Unicode code point escape (issue 521)
* Improve the speed and accuracy of comment attachment (issue 522)
* Support ES6 default parameter (issue 519)
* Support ES6 regular expression flags (issue 557)
* Fix scanning of implicit octal literals (issue 565)
* Fix the handling of automatic semicolon insertion (issue 574)
* Support ES6 method definition (issue 620)
* Support ES6 octal integer literal (issue 621)
* Support ES6 binary integer literal (issue 622)
* Support ES6 object literal property value shorthand (issue 624)
  Esprima 是一个用于教育目的的 ECMAScript(JavaScript) 解析架构,主要用于多用途分析。其本身也是使用 ECMAScript 编写的。
  主要特性:

[*]  支持 ECMAScript 5.1
[*]  抽象语法树 (AST) 敏感的格式,兼容 Mozilla Parser API
[*]  经过重度测试,超过 500 个单元测试以及 100% 的代码覆盖
[*]  可选跟踪语法节点定位 (index-based and line-column)
[*]  超级快,速度是 UglifyJS parse-js 的 2.5 倍(speed comparison)
页: [1]
查看完整版本: Esprima 2.0 发布,支持 ES6 特性