New in 4.0: JavaScript.next Syntax Support
As you may know, there are different versions of the JavaScript language. Each JavaScript engine implementation adds some nice features that others don’t have. To make sure that you only use features suitable for targeted environments, choose an appropriate one in Settings | JavaScript.
When you use language feature that isn’t supported by the currently selected JavaScript version, WebStorm will notify you and suggest a Quick-Fix:
For those who prefer to stay one step ahead, WebStorm presents an experimental support of a new ongoing ECMAScript version code-named Harmony. New language features are poorly supported natively by browsers[1], but there are third-party tools for translating new syntax constructs into their JavaScript equivalents. We take Traceur compiler as a basis. The full list of supported features can be found on its wiki.
To try out new features, set ECMAScript Harmony to be the JavaScript language version in settings. There are two ways of using the new language features with your web project. One is to compile ECMAScript Harmony files before the deployment. Another is to provide a link on your html page to javascript sources of Traceur compiler, so that ECMAScript Harmony files are translated to JavaScript on each request. Instructions and an example can be found here.
To help you with the new syntax, we’ve added a possibility to preview files compiled with Traceur. Simply right-click in the editor and select Compile ES6 file with Traceur:
Download PhpStorm & WebStorm 4.0 EAP. We’d also love to get your feedback in the issue tracker ;)
[1] Chromium project recently announced that implements some ECMAScript Harmony features. Firefox’s JavaScript engine already contains many of them and some more.