Merge branch '3.99.1' into 4.0.1

This commit is contained in:
Steve Gravrock
2022-02-21 16:45:34 -08:00
4 changed files with 125 additions and 2 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;
};