问题
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.
回答1:
Go to the Preferences > Languages & Frameworks > JavaScript and chose ECMAScript 6 for JavaScript language version.
来源:https://stackoverflow.com/questions/28131742/webstorm-generator-function-not-accepted