Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript meteor for(let x of y)未由ecmascript翻译_Javascript_Android_Meteor_Ecmascript 6 - Fatal编程技术网

Javascript meteor for(let x of y)未由ecmascript翻译

Javascript meteor for(let x of y)未由ecmascript翻译,javascript,android,meteor,ecmascript-6,Javascript,Android,Meteor,Ecmascript 6,我有一个应用程序在某些设备/浏览器上产生错误(例如在Android默认浏览器上) 经过一段时间的调试,我注意到一些ES6代码似乎滑到了生成的JS中: Template.updateAccountModalInner.helpers({ notAllEmailsVerified: function () { const user = Session.get('userInScope'); if (!user || !user.emails) { return n

我有一个应用程序在某些设备/浏览器上产生错误(例如在Android默认浏览器上)

经过一段时间的调试,我注意到一些ES6代码似乎滑到了生成的JS中:

Template.updateAccountModalInner.helpers({
  notAllEmailsVerified: function () {
    const user = Session.get('userInScope');
    if (!user || !user.emails) {
        return null;
    }
    for(let email of user.emails) {
        if (!email.verified) {
            return true;
        }
    }
    return false;
},
尽管我使用ecmascript包(ecmascript@0.7.3,ecmascript-runtime@0.3.15)“for(让email of user.emails)”保留在生成的文件中

在package.json中,我有:

  "dependencies": {
    "babel-runtime": "^6.23.0",
    "bcrypt": "^1.0.2"
  }
这个语法正确吗?我需要为JS文件启用ES&for吗


IDEA建议我将a for(var x of y)转换为for(let x of y)…您是否安装了
ecmascript
软件包?什么是
user.emails
?是数组还是对象?是,ecmascript@0.7.3已安装。user.emails是一个数组。呃,我不知道你为什么在Android上会出现问题。我鼓励你尝试
some
。用
return user.emails.some替换你的循环(email=>!email.verified)
和delete
返回false
。啊,谢谢,不管怎样读起来还是不错的。我会试试这个。