gpt4 book ai didi

javascript - 在我的云代码中解析 "Unexpected identifier in main.js"

转载 作者:行者123 更新时间:2023-11-30 12:12:09 28 4
gpt4 key购买 nike

我正在尝试将我新编写的云代码函数部署到 Parse,但我在第 110 行不断收到错误“意外标识符”,我似乎无法弄清楚这里为什么会出现错误,有帮助吗?

Parse.Cloud.define("backgroundJob", function(request, response) {
Parse.Cloud.useMasterKey();

var moments = require("cloud/moments.js");

var now = moments.moment();
var groupObject = Parse.Object.extend("Group");
var query = new Parse.Query(groupObject);

var eventObject = Parse.Object.extend("Event");

query.find().then(function(groups) {
var promise = Parse.Promise.as();
_.each(group, function(result) {
promise = promise.then(function() {
var count = 0;
var events = _.map(result.get("Events"), function(eventArray) {
if (now == eventArray[count].get('date') {

var curEvent = eventArray[count];
eventArray[count].destory();

var relationc = result.get("created");

var createdq = relationc.query();

var relationj = result.get("created");

var joinedq = relationj.query();

var partOnee = curEvent.get("name");
var outString = partOnee.concat(" is now");

Parse.Push.send({
where: createdq,
data: {
alert: outString
}
}).then(function() {
response.success();
}, function(error) {
response.error(error);
});

Parse.Push.send({
where: joinedq,
data: {
alert: outString
}
}).then(function() {
response.success();
}, function(error) {
response.error(error);
});

}

count = count+1;
});

});
});
}).then(function() {
response.success()
}, function(error) {
response.error(error);
});
});

第 110 行是var curEvent = eventArray[count];

最佳答案

你错过了)这一行 if (now == eventArray[count].get('date'),见:

        var events = _.map(result.get("Events"), function(eventArray) {
if (now == eventArray[count].get('date') {

修复:

        var events = _.map(result.get("Events"), function(eventArray) {
if (now == eventArray[count].get('date')) {

请注意,当解释器/编译器(在大多数编程语言中)说某行有问题时,通常问题可能出现在之前的任何一行。

关于javascript - 在我的云代码中解析 "Unexpected identifier in main.js",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33457480/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com