Support Error.stack in globalErrors.

See https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#window.onerror
This commit is contained in:
johnjbarton
2019-01-03 15:26:02 -08:00
parent 37dfe50d99
commit c36a005893
2 changed files with 5 additions and 2 deletions

View File

@@ -100,11 +100,12 @@ getJasmineRequireObj().Env = function(j$) {
if (!options.suppressLoadErrors) {
installGlobalErrors();
globalErrors.pushListener(function(message, filename, lineno) {
globalErrors.pushListener(function(message, filename, lineno, colNo, err) {
topSuite.result.failedExpectations.push({
passed: false,
globalErrorType: 'load',
message: message,
stack: err && err.stack,
filename: filename,
lineno: lineno
});