incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Eberhardt (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-155) localStorage does not work with square brace notation
Date Thu, 05 Jan 2012 17:07:39 GMT

    [ https://issues.apache.org/jira/browse/CB-155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13180530#comment-13180530
] 

Colin Eberhardt commented on CB-155:
------------------------------------

Hi Jesse, It is this specific case that concerns me, where the JavaScript code attempts to
persist a new property via dot or square brace notation:

localStorage.newKey = value;
or
localStorage["newKey"] = value;

There is a lot of JavaScript code out there that uses the above notation rather than using
getItem / setItem. The above fails without any warning.

With the above code, you iterate over the properties of your localStorage shim and discover
the 'newKey' property when the PhoneGap application exits, persisting it at that point.
                
> localStorage does not work with square brace notation
> -----------------------------------------------------
>
>                 Key: CB-155
>                 URL: https://issues.apache.org/jira/browse/CB-155
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.3.0
>            Reporter: Colin Eberhardt
>            Assignee: Jesse MacFadyen
>
> Currently the WP7 localStorage shim works if you use localStorage setItem / getItem methods,
however, it fails if you use the square brace notation:
> localStorage["key"] = someValue;

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message