Permalink
Browse files

new package

  • Loading branch information...
1 parent f3d6420 commit bdfff2c28fe26f81629ce11ebceb1abe7baa1536 @bcherry committed May 10, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 pkg/espionage.js
View
@@ -451,7 +451,7 @@ espionage.extend("spy", function(e) {
});
e.extendTeardown(function() {
- for (var i = 0; i < spiedFunctions.length; i++) {
+ for (var i = spiedFunctions.length - 1; i >= 0; i--) {
var spied = spiedFunctions[i];
if (spied.namespace) {
spied.namespace[spied.property] = spied.original;
@@ -537,7 +537,7 @@ espionage.extend("stub", function(e) {
});
e.extendTeardown(function() {
- for (var i = 0; i < stubbedFunctions.length; i++) {
+ for (var i = stubbedFunctions.length - 1; i >= 0; i--) {
var stubbed = stubbedFunctions[i];
stubbed.namespace[stubbed.property] = stubbed.original;

0 comments on commit bdfff2c

Please sign in to comment.