Reverse order that spies are cleared up.

Fixes #1010
This commit is contained in:
DJ Burrowes
2016-01-03 19:14:57 -08:00
parent 0d4c8d13bb
commit 65241565c5
2 changed files with 20 additions and 1 deletions

View File

@@ -49,7 +49,7 @@ getJasmineRequireObj().SpyRegistry = function(j$) {
this.clearSpies = function() {
var spies = currentSpies();
for (var i = 0; i < spies.length; i++) {
for (var i = spies.length - 1; i >= 0; i--) {
var spyEntry = spies[i];
spyEntry.baseObj[spyEntry.methodName] = spyEntry.originalValue;
}