Clear timeouts when starting to process a milli instead of at the end

- Fixes #1482
This commit is contained in:
Gregg Van Hove
2018-01-19 17:47:28 -08:00
parent c82e5947f5
commit 53529bdc9a
2 changed files with 17 additions and 1 deletions

View File

@@ -124,6 +124,7 @@ getJasmineRequireObj().DelayedFunctionScheduler = function(j$) {
}
do {
deletedKeys = [];
var newCurrentTime = scheduledLookup.shift();
tickDate(newCurrentTime - currentTime);
@@ -146,7 +147,6 @@ getJasmineRequireObj().DelayedFunctionScheduler = function(j$) {
}
funcToRun.funcToCall.apply(null, funcToRun.params || []);
});
deletedKeys = [];
} while (scheduledLookup.length > 0 &&
// checking first if we're out of time prevents setTimeout(0)
// scheduled in a funcToRun from forcing an extra iteration