Merge branch '4.0.1'

This commit is contained in:
Steve Gravrock
2022-02-21 17:08:11 -08:00
7 changed files with 149 additions and 5 deletions

View File

@@ -177,7 +177,10 @@ getJasmineRequireObj().QueueRunner = function(j$) {
maybeThenable = queueableFn.fn.call(self.userContext);
if (maybeThenable && j$.isFunction_(maybeThenable.then)) {
maybeThenable.then(next, onPromiseRejection);
maybeThenable.then(
wrapInPromiseResolutionHandler(next),
onPromiseRejection
);
completedSynchronously = false;
return { completedSynchronously: false };
}
@@ -276,5 +279,15 @@ getJasmineRequireObj().QueueRunner = function(j$) {
}
};
function wrapInPromiseResolutionHandler(fn) {
return function(maybeArg) {
if (j$.isError_(maybeArg)) {
fn(maybeArg);
} else {
fn();
}
};
}
return QueueRunner;
};