@@ -63,8 +63,25 @@ getJasmineRequireObj().GlobalErrors = function(j$) {
|
||||
var originalHandler = global.onerror;
|
||||
global.onerror = onerror;
|
||||
|
||||
var browserRejectionHandler = function browserRejectionHandler(event) {
|
||||
onerror('Unhandled Rejection: ' + event.reason);
|
||||
};
|
||||
|
||||
if (global.addEventListener) {
|
||||
global.addEventListener(
|
||||
'unhandledrejection',
|
||||
browserRejectionHandler
|
||||
);
|
||||
}
|
||||
|
||||
this.uninstall = function uninstall() {
|
||||
global.onerror = originalHandler;
|
||||
if (global.removeEventListener) {
|
||||
global.removeEventListener(
|
||||
'unhandledrejection',
|
||||
browserRejectionHandler
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user