Commit b33206f3 b33206f3a0283c73b5974e00bf3877249953bddc by Nicolas Perriault

DRYed interval clearance in Casper.waitFor()

1 parent a4b5c575
...@@ -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 });
......