fix typo in local storage
This commit is contained in:
parent
678316ac95
commit
aa832ae475
1 changed files with 7 additions and 7 deletions
|
|
@ -12,28 +12,28 @@
|
||||||
this.__mem__ = true;
|
this.__mem__ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var KP = Local.prototype;
|
var LS = Local.prototype;
|
||||||
|
|
||||||
KP.getItem = function(key) {
|
LS.getItem = function(key) {
|
||||||
return this[key];
|
return this[key];
|
||||||
};
|
};
|
||||||
|
|
||||||
KP.setItem = function(key, val) {
|
LS.setItem = function(key, val) {
|
||||||
this.__data__[key] = val;
|
this.__data__[key] = val;
|
||||||
this[key] = val;
|
this[key] = val;
|
||||||
};
|
};
|
||||||
|
|
||||||
KP.removeItem = function(key) {
|
LS.removeItem = function(key) {
|
||||||
delete this.__data__[key];
|
delete this.__data__[key];
|
||||||
};
|
};
|
||||||
|
|
||||||
KP.clear = function() {
|
LS.clear = function() {
|
||||||
this.__data__ = {};
|
this.__data__ = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let local = data.Local = self.localStorage,
|
let local = data.Local = self.localStorage;
|
||||||
testkey = '__test';
|
let testkey = '__test';
|
||||||
local.setItem(testkey, 1);
|
local.setItem(testkey, 1);
|
||||||
local.getItem(testkey);
|
local.getItem(testkey);
|
||||||
local.removeItem(testkey);
|
local.removeItem(testkey);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue