Correctly remove spies of window.onerror on IE
This commit is contained in:
@@ -4809,6 +4809,7 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
|
||||
|
||||
function SpyRegistry(options) {
|
||||
options = options || {};
|
||||
var global = options.global || j$.getGlobal();
|
||||
var currentSpies = options.currentSpies || function() { return []; };
|
||||
|
||||
this.allowRespy = function(allow){
|
||||
@@ -4852,7 +4853,7 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
|
||||
spiedMethod = j$.createSpy(methodName, originalMethod),
|
||||
restoreStrategy;
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(obj, methodName)) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, methodName) || (obj === global && methodName === 'onerror')) {
|
||||
restoreStrategy = function() {
|
||||
obj[methodName] = originalMethod;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user