diff --git a/lib/index.js b/lib/index.js index 6bddfcf..91b3539 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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); diff --git a/lib/package.json b/lib/package.json index 6fd005a..2400d9a 100644 --- a/lib/package.json +++ b/lib/package.json @@ -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"