Webstorm generator function not accepted

I am trying to use iojs with koa , which works well. But Webstorm does not accept generator functions as valid.

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

My actual version is Webstorm 9 . Maybe a workaround? I could not find a suitable option.

+6
source share
1 answer

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

+13
source

Source: https://habr.com/ru/post/981501/


All Articles