Webstorm generator功能不被接受 [英] Webstorm generator function not accepted

查看:213
本文介绍了Webstorm generator功能不被接受的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 iojs koa ,效果不错。但是, Webstorm 不接受生成器函数的有效。

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';
}); 

我的实际版本是 Webstorm 9
有没有解决办法?我找不到匹配的选项。

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

推荐答案

转到首选项> 语言与框架> JavaScript 并为选择 ECMAScript 6 JavaScript语言版本

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

这篇关于Webstorm generator功能不被接受的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆