Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-5025

WP7 localStorage.getItem unexpected behaviour.

VotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Javascript for WP7 localStorage.getItem returns string 'undefined' when specified key exists and value is undefined. This scenario can be reproduced by 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;

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            Elvedin Elvedin Hamzagic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment