Merge branch 'onerror' of https://github.com/johnjbarton/jasmine into johnjbarton-onerror

- Merges #1644 from @jognjbarton
This commit is contained in:
Gregg Van Hove
2019-01-30 17:36:31 -08:00
6 changed files with 11 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright (c) 2008-2018 Pivotal Labs
Copyright (c) 2008-2019 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -1,5 +1,5 @@
/*
Copyright (c) 2008-2018 Pivotal Labs
Copyright (c) 2008-2019 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -1,5 +1,5 @@
/*
Copyright (c) 2008-2018 Pivotal Labs
Copyright (c) 2008-2019 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -877,11 +877,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
});

View File

@@ -1,5 +1,5 @@
/*
Copyright (c) 2008-2018 Pivotal Labs
Copyright (c) 2008-2019 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -2046,6 +2046,7 @@ describe("Env integration", function() {
passed: false,
globalErrorType: 'load',
message: 'Uncaught SyntaxError: Unexpected end of input',
stack: 'a stack',
filename: 'borkenSpec.js',
lineno: 42
},
@@ -2053,6 +2054,7 @@ describe("Env integration", function() {
passed: false,
globalErrorType: 'load',
message: 'Uncaught Error: ENOCHEESE',
stack: undefined,
filename: undefined,
lineno: undefined
}
@@ -2062,7 +2064,7 @@ describe("Env integration", function() {
});
env.addReporter(reporter);
global.onerror('Uncaught SyntaxError: Unexpected end of input', 'borkenSpec.js', 42);
global.onerror('Uncaught SyntaxError: Unexpected end of input', 'borkenSpec.js', 42, undefined, {stack: 'a stack'});
global.onerror('Uncaught Error: ENOCHEESE');
env.execute();

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
});