Node.js Chrome V8 将实现 ES6 的类语法(class)

newghost · 2014年08月19日 · 最后由 mogodb 回复于 2015年03月08日 · 8175 次阅读

mplement ES6 classes including:

  • class declaration syntax

  • enchancements to objects literal syntax

  • ‘super’ keyword and Function.prototype.toMethod

The implementation will proceed in V8 under --harmony-classes flag.

Owners: Adam Klein ([email protected]), Erik Arvidsson ([email protected]), Dmitry Lomov ([email protected])

TC39 acceptance

Classes (in the form of compromise “maximally-minimal” classes) has been a part of ES6 for more than a year now. The complete spec has been in ES6 specification draft for quite a while.

At a July 2014 TC39 meeting some significant changes to instantiation semantics for classes were proposed, so the specification may still change in certain aspects.

However implementation of classes is a significant effort for V8, and critically important for Javascript community. It is critical that TC39 receives deep implementation feedback on the feature earlier than later. To mitigate spec changes impact, two of the owners (Erik & Dmitry) are directly involved with ‘instantiation reform’ proposal on TC39. Therefore we believe now is the right time to proceed with ES6 classes’ implementation.

Interest from other vendors

None of browser vendors currently ship ES6 classes, even though both Firefox and IE stated the intent of doing so.

Technical considerations

Design document:

https://docs.google.com/a/chromium.org/document/d/1UaIt5SeiM-DI8tSOhtM39eSOpjkDiv2UxP9eFK35Rno/

Cheers, Adam, Erik, Dmitry

翻译 http://ourjs.com/detail/53f1af7ba9fd2b242d000002

啥时候会完全支持呢?

需要 登录 后方可回复, 如果你还没有账号请 注册新账号