Correctly route errors that occur while a QueueRunner is clearing stack
Besides surfacing the error in the hopefully-correct place, this also prevents the queue runners for sibling suites from interleaving, which in turn prevents all kinds of internal state corruption. Signed-off-by: Gregg Van Hove <gvanhove@pivotal.io>
This commit is contained in:
committed by
Gregg Van Hove
parent
2835ca3cce
commit
b1e97cfb09
@@ -24,6 +24,11 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
||||
}
|
||||
|
||||
QueueRunner.prototype.execute = function() {
|
||||
var self = this;
|
||||
this.handleFinalError = function(error) {
|
||||
self.onException(error);
|
||||
};
|
||||
this.globalErrors.pushListener(this.handleFinalError);
|
||||
this.run(this.queueableFns, 0);
|
||||
};
|
||||
|
||||
@@ -43,7 +48,10 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
||||
}
|
||||
}
|
||||
|
||||
this.clearStack(this.onComplete);
|
||||
this.clearStack(function() {
|
||||
self.globalErrors.popListener(self.handleFinalError);
|
||||
self.onComplete();
|
||||
});
|
||||
|
||||
function attemptSync(queueableFn) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user