Skip to content

Commit 3cb7e1c

Browse files
authored
Merge pull request #102 from knalbandianbrightgrove/fix/IE8-array.foreach-remove
Make compatible with IE8
2 parents 1583cd6 + c91581b commit 3cb7e1c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/rule.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ class Rule extends EventEmitter {
206206
}
207207
let orderedSets = this.prioritizeConditions(conditions)
208208
let cursor = Promise.resolve()
209-
orderedSets.forEach((set) => {
209+
// use for() loop over Array.forEach to support IE8 without polyfill
210+
for (let i = 0; i < orderedSets.length; i++) {
211+
let set = orderedSets[i]
210212
let stop = false
211213
cursor = cursor.then((setResult) => {
212214
// after the first set succeeds, don't fire off the remaining promises
@@ -225,7 +227,7 @@ class Rule extends EventEmitter {
225227
// all conditions passed; proceed with running next set in parallel
226228
return evaluateConditions(set, method)
227229
})
228-
})
230+
}
229231
return cursor
230232
}
231233

0 commit comments

Comments
 (0)