fallback on assignment when a spy cannot be deleted

This commit is contained in:
Sean Parmelee
2016-09-01 13:39:25 -05:00
parent c7cc3b4a29
commit 8676bbf11a
2 changed files with 27 additions and 2 deletions

View File

@@ -53,7 +53,9 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
};
} else {
restoreStrategy = function() {
delete obj[methodName];
if (!delete obj[methodName]) {
obj[methodName] = originalMethod;
}
};
}