Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 529
Alex Avatar asked Jan 25 '15 00:01

Alex


1 Answers

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

like image 111
alexpods Avatar answered Nov 05 '22 23:11

alexpods