Search code examples
idegeneratorwebstormecmascript-6

Webstorm generator function not accepted


I'm trying to use iojs with koa, what works well. But Webstorm doesn't accept the generator functions as valid.

/** gets marked as syntactically invalid code */
app.use(function *() {
    this.body = 'Hello World';
}); 

My actual version is Webstorm 9. Is there maybe a workaround? I couldn't find a matching option for it.


Solution

  • Go to the Preferences > Languages & Frameworks > JavaScript and chose ECMAScript 6 for JavaScript language version.