Skip to content

Commit

Permalink
fixed arrays handleing to work in firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
Derick Bailey committed Aug 2, 2011
1 parent 342f52e commit 7019284
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions backbone.memento.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Backbone.Memento v0.1.0
// Backbone.Memento v0.1.1
//
// Copyright (C)2011 Derick Bailey, Muted Solutions, LLC
// Distributed Under MIT Liscene
Expand All @@ -10,7 +10,7 @@
// Backbone.Memento
// ----------------------------
Backbone.Memento = (function(model){
var attributeStack = {};
var attributeStack = new Array();

function getRemovedAttrDiff(newAttrs, oldAttrs){
var removedAttrs = [];
Expand All @@ -34,15 +34,14 @@ Backbone.Memento = (function(model){
}

return {
version: "0.1.0",
version: "0.1.1",

push: function(){
var count = Object.keys(attributeStack).length;
attributeStack[count] = model.toJSON();
attributeStack.push(model.toJSON());
},

pop: function(){
var last = Object.keys(attributeStack).length-1;
var last = attributeStack.length-1;
if (last < 0)
return null;

Expand Down

0 comments on commit 7019284

Please sign in to comment.