continue connloop; throws Syntax Error: Unsyntactic continue.
If I change continue connloop; to continue; , it will run (but ofcourse it will not execute on the outer loop but on the inner one)
Why is this happening, is this deprecated or illegal in nodejs/ecma6?
Please do not recommend me to use function calls instead of labels.
redisSubscriber.on("message", function(channel, event){
event = JSON.parse(event);
const eventPayload = JSON.stringify(event.payload);
connloop:
for(let conn in connections){
conn = connections[conn];
redisClient.SMEMBERS('connection/'+conn.id+'/subscriptions', (err, subscriptions)=>{
let intersectedTags = [];
if(event.address.tags.length > 0 && subscriptions.length > 0){
for(let tag in subscriptions){
tag = subscriptions[tag];
for(let _tag in event.address.tags){
_tag = event.address.tags[_tag];
if(tag == _tag)
intersectedTags.push(tag);
}
}
}
let exclusive = false;
for(let userId in event.address.include){
userId = event.address.include[userId];
if(userId == conn.userId){
exclusive = true;
break;
}
}
if(intersectedTags.length > 0 || exclusive){
if(event.address.exclude){
for(let exclude in event.address.exclude){
exclude = event.address.exclude[exclude];
if(exclude == conn.userId){
continue connloop;
}
}
}
const browserEvent = {tags: intersectedTags, notification: eventPayload, exclusive};
conn.write(JSON.stringify(browserEvent));
}
})
} });