[jira] [Updated] (CB-5025) WP7 localStorage.getItem unexpected behaviour.

2013-10-09 Thread Elvedin Hamzagic (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-5025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Elvedin Hamzagic updated CB-5025:
-

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;



  was:
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;




> WP7 localStorage.getItem unexpected behaviour.
> --
>
> Key: CB-5025
> URL: https://issues.apache.org/jira/browse/CB-5025
> Project: Apache Cordova
>  Issue Type: Bug
>Reporter: Elvedin Hamzagic
>Priority: Minor
>  Labels: localStorage
>
> 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;



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Created] (CB-5025) WP7 localStorage.getItem unexpected behaviour.

2013-10-09 Thread Elvedin Hamzagic (JIRA)
Elvedin Hamzagic created CB-5025:


 Summary: WP7 localStorage.getItem unexpected behaviour.
 Key: CB-5025
 URL: https://issues.apache.org/jira/browse/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
(v6.1#6144)