fix typo in local storage

This commit is contained in:
Stewart Allen 2021-12-28 16:42:33 -05:00
commit aa832ae475

View file

@ -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);