fixed bug where if toJSON is called before keys, it threw an error
This commit is contained in:
parent
16fb1c730e
commit
a704e4ad02
@ -75,6 +75,7 @@
|
||||
|
||||
this._store = w3cStorage;
|
||||
this._keysAreDirty = true;
|
||||
this._keys = [];
|
||||
if (!this._store.getItem('_json-storage-namespaced_')) {
|
||||
upgradeStorage(this, w3cStorage);
|
||||
}
|
||||
@ -135,7 +136,7 @@
|
||||
var json = {}
|
||||
;
|
||||
|
||||
this._keys.forEach(function (key) {
|
||||
this.keys().forEach(function (key) {
|
||||
json[key] = this.get(key);
|
||||
}, this);
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
"name": "json-storage",
|
||||
"description": "A wrapper for storage engines which use the W3C Storage API",
|
||||
"keywords": ["ender", "localStorage", "sessionStorage", "globalStorage", "Storage"],
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/coolaj86/json-storage-js.git"
|
||||
|
Loading…
x
Reference in New Issue
Block a user