Treat any argument to the done callback as an error
This reduces the risk of incorrectly passing a spec due to not correctly detecting that an argument is an `Error` instance. Detecting Error instances in a way that's reliable and portable across different browsers, TrustedTypes, and frames is difficult. [Finishes #178267587]
This commit is contained in:
@@ -100,17 +100,11 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
||||
next = once(function next(err) {
|
||||
cleanup();
|
||||
|
||||
if (j$.isError_(err)) {
|
||||
if (typeof err !== 'undefined') {
|
||||
if (!(err instanceof StopExecutionError) && !err.jasmineMessage) {
|
||||
self.fail(err);
|
||||
}
|
||||
self.errored = errored = true;
|
||||
} else if (typeof err !== 'undefined' && !self.errored) {
|
||||
self.deprecated(
|
||||
'Any argument passed to a done callback will be treated as an ' +
|
||||
'error in a future release. Call the done callback without ' +
|
||||
"arguments if you don't want to trigger a spec failure."
|
||||
);
|
||||
}
|
||||
|
||||
function runNext() {
|
||||
|
||||
Reference in New Issue
Block a user