Pick the error instance to pass to error handlers in QueueRunner

The first number is the error message in HTML5 browser, which does not include
the call stack. The error instance allows logging the complete call stack in
reporters.
This commit is contained in:
Ferdinand Prantl
2019-08-11 09:32:31 +02:00
parent 527619b0aa
commit 3a7fc63879
2 changed files with 31 additions and 2 deletions

View File

@@ -49,8 +49,11 @@ getJasmineRequireObj().QueueRunner = function(j$) {
QueueRunner.prototype.execute = function() {
var self = this;
this.handleFinalError = function(error) {
self.onException(error);
this.handleFinalError = function(message, source, lineno, colno, error) {
// Older browsers would send the error as the first parameter. HTML5
// specifies the the five parameters above. The error instance should
// be preffered, otherwise the call stack would get lost.
self.onException(error || message);
};
this.globalErrors.pushListener(this.handleFinalError);
this.run(0);