Skip to content

Commit

Permalink
Merge pull request #88 from QuickCorp/v2.3
Browse files Browse the repository at this point in the history
fixing polyfill of localStorage
  • Loading branch information
jeanmachuca committed Aug 18, 2021
2 parents 48de597 + 842b8d4 commit 51d0df7
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions QCObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,23 +437,23 @@
_waitUntil(func, exp);
}, 1);
};
if (typeof localStorage === "undefined"){
/* Polyfill for localStorage */
var localStorage = {
getItem (name) {
return (Object.hasOwnProperty.call(this, name))?(this[name]):(null);
},
setItem (name, value) {
this[name] = value;
},
removeItem (name) {
delete this[name];
}
};
/* end Polyfill for localStorage */
}
var ComplexStorageCache = function(params) {
var object, load, alternate;
if (typeof localStorage === "undefined"){
/* Polyfill for localStorage */
var localStorage = {
getItem (name) {
return (Object.hasOwnProperty.call(this, name))?(this[name]):(null);
},
setItem (name, value) {
this[name] = value;
},
removeItem (name) {
delete this[name];
}
};
/* end Polyfill for localStorage */
}
object = params.index;
load = params.load;
alternate = params.alternate;
Expand Down

0 comments on commit 51d0df7

Please sign in to comment.