W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2010

Re: [widgets] Storage keys and ECMAScript incompatibility?

From: Scott Wilson <scott.bradley.wilson@gmail.com>
Date: Wed, 15 Dec 2010 16:09:27 +0000
Cc: public-webapps WG <public-webapps@w3.org>
Message-Id: <3DD3BAB1-1FC6-487C-9E56-80AC907447DC@gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
On 15 Dec 2010, at 15:50, Tab Atkins Jr. wrote:

> On Wed, Dec 15, 2010 at 5:29 AM, Scott Wilson
> <scott.bradley.wilson@gmail.com> wrote:
>> We've come across an issue with storage keys in Widget preferences; namely
>> that the Web Storage spec [1] states that:
>> Keys are strings. Any string (including the empty string) is a valid key.
>> Values can be any data type supported by the structured clone algorithm.
>> However, common guidance on JavaScript states that:
>> Variable names must begin with a letter or the underscore character
>> ECMAScript[3] follows the Unicode identifier syntax[4], which defines
>> variable names as starting with:
>> Characters having the Unicode General_Category of uppercase letters (Lu),
>> lowercase letters (Ll), titlecase letters (Lt), modifier letters (Lm), other
>> letters (Lo), letter numbers (Nl), minus Pattern_Syntax
>> and Pattern_White_Space code points, plus stability extensions
>> So we get into problems using keys that begin with digits, which are allowed
>> as far as I can tell in WebStorage and Widgets, but not in ECMAScript, and
>> things like "widgets.preferences.12345="xyz" throw exceptions.
> timeless got it.  Only a subset of possible keys can be used in the
> dot syntax.  Everything else can be used in the array notation
> instead.  This is perfectly fine.
> ~TJ

OK, we'll implement using array notation instead. 


Received on Wednesday, 15 December 2010 16:10:06 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:28 UTC