Improved ECMAScript 2015 (ES6) supportV8 4.5 adds support for several ECMAScript 2015 (ES6) features.
Arrow FunctionsWith the help of Arrow Functions it is possible to write more streamlined code.
The lexical binding of 'this' is another major benefit of arrow functions. As a result, using callbacks in methods gets much easier.
Array/TypedArray functionsAll of the new methods on Arrays and TypedArrays that are specified in ES2015 are now supported in 4.5. They make working with Arrays and TypedArrays more convenient. Among the methods added are Array.from and Array.of. Methods which mirror most Array methods on each kind of TypedArray were added as well.
Object.assignObject.assign enables developers to quickly merge and clone objects.
This feature can also be used to mix in functionality.
Here is an example of code that uses 'for-of', which can now be compiled by TurboFan:
Although initially functions that use these language features won't reach the same peak performance as other code compiled by Crankshaft, TurboFan can now speed them up well beyond our current baseline compiler. Even better, performance will continue to improve quickly as we develop more optimizations for TurboFan.
V8 APIPlease check out our summary of API changes. This document gets regularly updated a few weeks after each major release.
Developers with an active V8 checkout can use 'git checkout -b 4.5 -t branch-heads/4.5' to experiment with the new features in V8 4.5. Alternatively you can subscribe to Chrome's Beta channel and try the new features out yourself soon.
Posted by the V8 team