Skip to content

Commit

Permalink
Fixed an issue where oldAttrs was leaked to global scope.
Browse files Browse the repository at this point in the history
- Added 'use strict'; to top of code to avoid similar problems in the future.
  • Loading branch information
fizker committed Nov 3, 2011
1 parent ec39fc4 commit b6587e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backbone.memento.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// http://github.com/derickbailey/backbone.memento

Backbone.Memento = (function(Backbone, _){
'use strict';
// ----------------------------
// Memento: the public API
// ----------------------------
Expand Down Expand Up @@ -99,7 +100,7 @@ Backbone.Memento = (function(Backbone, _){
}

function restoreState(previousState, restoreConfig){
oldAttrs = dropIgnored(previousState, restoreConfig);
var oldAttrs = dropIgnored(previousState, restoreConfig);

//get the current state
var currentAttrs = structure.toJSON();
Expand Down

0 comments on commit b6587e5

Please sign in to comment.