DRYed interval clearance in Casper.waitFor()
Showing
1 changed file
with
1 additions
and
2 deletions
... | @@ -1089,14 +1089,13 @@ Casper.prototype.waitFor = function waitFor(testFx, then, onTimeout, timeout) { | ... | @@ -1089,14 +1089,13 @@ Casper.prototype.waitFor = function waitFor(testFx, then, onTimeout, timeout) { |
1089 | } else { | 1089 | } else { |
1090 | self.die(f("Timeout of %dms expired, exiting.", timeout), "error"); | 1090 | self.die(f("Timeout of %dms expired, exiting.", timeout), "error"); |
1091 | } | 1091 | } |
1092 | clearInterval(interval); | ||
1093 | } else { | 1092 | } else { |
1094 | self.log(f("waitFor() finished in %dms.", new Date().getTime() - start), "info"); | 1093 | self.log(f("waitFor() finished in %dms.", new Date().getTime() - start), "info"); |
1095 | if (then) { | 1094 | if (then) { |
1096 | self.then(then); | 1095 | self.then(then); |
1097 | } | 1096 | } |
1098 | clearInterval(interval); | ||
1099 | } | 1097 | } |
1098 | clearInterval(interval); | ||
1100 | } | 1099 | } |
1101 | }, 100, this, testFx, timeout, onTimeout); | 1100 | }, 100, this, testFx, timeout, onTimeout); |
1102 | }); | 1101 | }); | ... | ... |
-
Please register or sign in to post a comment