Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ class Rule extends EventEmitter {
}
let orderedSets = this.prioritizeConditions(conditions)
let cursor = Promise.resolve()
orderedSets.forEach((set) => {
// use for() loop over Array.forEach to support IE8 without polyfill
for (let i = 0; i < orderedSets.length; i++) {
let set = orderedSets[i]
let stop = false
cursor = cursor.then((setResult) => {
// after the first set succeeds, don't fire off the remaining promises
Expand All @@ -225,7 +227,7 @@ class Rule extends EventEmitter {
// all conditions passed; proceed with running next set in parallel
return evaluateConditions(set, method)
})
})
}
return cursor
}

Expand Down