incubator-callback-dev mailing list archives

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

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

Patrick Mueller commented on CB-155:
------------------------------------

Don't know if WP7 has any tricks up it's sleeve, but as far as I know with JSC and V8, there's
no way to "simulate" array accessors like this.  The alternative is for folks to code to the
alternate APIs, listed here: https://developer.mozilla.org/en/DOM/Storage ; specifically:

interface Storage {
  DOMString key(in unsigned long index);
  DOMString getItem(in DOMString key);
  void setItem(in DOMString key, in DOMString data);
  void removeItem(in DOMString key);
 }

Note, this still leaves the "length" attribute, which it may be possible to fake with a "getter"
property, via Object.defineProperty():

    https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperty

Usage of Object.__defineGetter__()/__defineSetter__() instead of defineProperty() is probably
best avoided, unless that's the only way we can do it with WP7.

                
> 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