Commit 4b2588af authored by Tristan Cavelier's avatar Tristan Cavelier

property "..." is non-configurable and can't be deleted -> fixed

Firefox 23 does not allow the use of `delete localStorage[value];` anymore.  We
have to use `localStorage.removeItem(value);` and all other localStorage
methods.
parent 37c7c418
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
return localStorage.setItem(item, JSON.stringify(value)); return localStorage.setItem(item, JSON.stringify(value));
}, },
removeItem: function (item) { removeItem: function (item) {
delete localStorage[item]; return localStorage.removeItem(item);
}, },
clone: function () { clone: function () {
return JSON.parse(JSON.stringify(localStorage)); return JSON.parse(JSON.stringify(localStorage));
...@@ -41,8 +41,7 @@ ...@@ -41,8 +41,7 @@
localstorage = { localstorage = {
getItem: function (item) { getItem: function (item) {
var value = pseudo_localStorage[item]; var value = pseudo_localStorage[item];
return value === undefined ? return value === undefined ? null : JSON.parse(value);
null : JSON.parse(pseudo_localStorage[item]);
}, },
setItem: function (item, value) { setItem: function (item, value) {
pseudo_localStorage[item] = JSON.stringify(value); pseudo_localStorage[item] = JSON.stringify(value);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment