Skip to content

Commit

Permalink
changing updateActivityToTargets to avoid using .includes, which isn'…
Browse files Browse the repository at this point in the history
…t included in Node 4
  • Loading branch information
kenhoff committed Jan 23, 2018
1 parent 3a9b9eb commit bc51d5f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/feed.js
Expand Up @@ -347,9 +347,14 @@ StreamFeed.prototype = {
if (added_targets && removed_targets) {
// brute force - iterate through added, check to see if removed contains that element
for (var i = 0; i < added_targets.length; i++) {
if (removed_targets.includes(added_targets[i])) {
throw new Error("Can't have the same feed ID in added_targets and removed_targets.");
// would normally use Array.prototype.includes here, but it's not supported in Node.js v4 :(
for (var j = 0; j < removed_targets.length; j++) {
if (removed_targets[j] == added_targets[i]) {
throw new Error("Can't have the same feed ID in added_targets and removed_targets.");
}
}
// if (removed_targets.includes(added_targets[i])) {
// }
}
}

Expand Down

0 comments on commit bc51d5f

Please sign in to comment.