Fixed global error handler stack corruption in Jasmine's own tests

This commit is contained in:
Steve Gravrock
2020-09-02 09:31:35 -07:00
parent 5a715aecee
commit 00feef8632
14 changed files with 833 additions and 985 deletions

View File

@@ -705,7 +705,8 @@ getJasmineRequireObj().Env = function(j$) {
queueRunnerFactory
);
this.execute = function(runnablesToRun) {
// Both params are optional.
this.execute = function(runnablesToRun, onComplete) {
installGlobalErrors();
if (!runnablesToRun) {
@@ -813,7 +814,11 @@ getJasmineRequireObj().Env = function(j$) {
failedExpectations: topSuite.result.failedExpectations,
deprecationWarnings: topSuite.result.deprecationWarnings
},
function() {}
function() {
if (onComplete) {
onComplete();
}
}
);
});
}

View File

@@ -1,4 +1,6 @@
getJasmineRequireObj().QueueRunner = function(j$) {
var nextid = 1;
function StopExecutionError() {}
StopExecutionError.prototype = new Error();
j$.StopExecutionError = StopExecutionError;
@@ -18,6 +20,7 @@ getJasmineRequireObj().QueueRunner = function(j$) {
function emptyFn() {}
function QueueRunner(attrs) {
this.id_ = nextid++;
var queueableFns = attrs.queueableFns || [];
this.queueableFns = queueableFns.concat(attrs.cleanupFns || []);
this.firstCleanupIx = queueableFns.length;