From callback-dev-return-1144-apmail-incubator-callback-dev-archive=incubator.apache.org@incubator.apache.org Fri Jan 6 09:04:19 2012 Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D0B2BBCC6 for ; Fri, 6 Jan 2012 09:04:19 +0000 (UTC) Received: (qmail 74352 invoked by uid 500); 6 Jan 2012 09:04:19 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 74170 invoked by uid 500); 6 Jan 2012 09:04:09 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 74140 invoked by uid 99); 6 Jan 2012 09:04:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2012 09:04:03 +0000 X-ASF-Spam-Status: No, hits=-2001.6 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2012 09:04:00 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 5399513B90E for ; Fri, 6 Jan 2012 09:03:39 +0000 (UTC) Date: Fri, 6 Jan 2012 09:03:39 +0000 (UTC) From: "Colin Eberhardt (Commented) (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <643997538.14014.1325840619343.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <715227326.8933.1325768259236.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CB-155) localStorage does not work with square brace notation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CB-155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13181209#comment-13181209 ] Colin Eberhardt commented on CB-155: ------------------------------------ Hi Jesse, No, there are no warnings on the VS debug output window if you use localStorage via dot or square brace notation. For a simple example, try replacing the PG started app index.html with the following: PhoneGap WP7

Your status:

There is no warning that this will not work. As a workaround, if I invoke the following code on application exit or deactivation (pause), it will ensure that anythign added to localStorage via a property is persisted: function persistLocalStorage() { for(var prop in localStorage) { if(localStorage.hasOwnProperty(prop) && (typeof localStorage[prop] === 'string')) { // invoke the setter in order to persist this property localStorage.setItem(prop, localStorage.prop); } } } Could this technique be used by the PG framework? Regards, Colin E. > 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