cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elvedin Hamzagic (JIRA)" <>
Subject [jira] [Created] (CB-5025) WP7 localStorage.getItem unexpected behaviour.
Date Wed, 09 Oct 2013 10:37:42 GMT
Elvedin Hamzagic created CB-5025:

             Summary: WP7 localStorage.getItem unexpected behaviour.
                 Key: CB-5025
             Project: Apache Cordova
          Issue Type: Bug
            Reporter: Elvedin Hamzagic
            Priority: Minor

Javascript for WP7 localStorage.getItem returns string 'undefined' when specified key exists
and value is undefined. This scenario can be triggered when adding some key/value to localStorage,
then removing it.

The actual line in code in getItem function, which produce this behaviour, is:
retVal = window.unescape(decodeURIComponent(this._result));
The problem is that decodeURIComponent return string 'undefined' when input is undefined,
and this should be fixed somehow like this:
retVal = this._result ? window.unescape(decodeURIComponent(this._result)) : this._result;

This message was sent by Atlassian JIRA

View raw message