Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Firefox 3.0.19 bug: globalStorage object needs to cast to String.
Run the following in Firefox 3.0.19: gs = window.globalStorage[window.location.hostname]; gs.s = "string value"; document.write(typeof(gs.s) + "<br>"); and you will see: object Despite being assigned a string value, the type is still object. This breaks jStorage when used with MooTools because MooTool's JSON.decode does this: function (string, secure) { if ($type(string) != "string" || !string.length) { return null; } Hence, we get the error "_storage is null" when using jStorage because it can't initialize proper;y. Note that it works with Prototype because their JSON decoder looks like this: function (str) { return String(str).evalJSON(); } To fix the issue I've put the String wrapper around _storage_service.jStorage when we try to decode it.
- Loading branch information