QueueRunner continues running functions in async case
Continue running functions even if an async spec throws an exception during the synchronous portion of the spec
This commit is contained in:
@@ -20,10 +20,13 @@ getJasmineRequireObj().QueueRunner = function() {
|
||||
for(iterativeIndex = recursiveIndex; iterativeIndex < length; iterativeIndex++) {
|
||||
var fn = fns[iterativeIndex];
|
||||
if (fn.length > 0) {
|
||||
attempt(function() {
|
||||
var attemptSuccessful = attempt(function() {
|
||||
fn.call(self, function() { self.run(fns, iterativeIndex + 1); });
|
||||
});
|
||||
return;
|
||||
|
||||
if(attemptSuccessful) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
attempt(function() { fn.call(self); });
|
||||
}
|
||||
@@ -41,6 +44,7 @@ getJasmineRequireObj().QueueRunner = function() {
|
||||
function attempt(fn) {
|
||||
try {
|
||||
fn();
|
||||
return true;
|
||||
} catch (e) {
|
||||
self.onException(e);
|
||||
if (!self.catchException(e)) {
|
||||
@@ -48,6 +52,7 @@ getJasmineRequireObj().QueueRunner = function() {
|
||||
//use a finally block to close the loop in a nice way..
|
||||
throw e;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user