W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2009

Re: Storage 'length' and enumeration

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 28 Apr 2009 23:05:24 +0000 (UTC)
To: John J Barton <johnjbarton@johnjbarton.com>
Cc: public-webapps@w3.org
Message-ID: <Pine.LNX.4.62.0904282303370.12381@hixie.dreamhostps.com>
On Tue, 28 Apr 2009, John J Barton wrote:
> Sorry, I don't follow what you mean. The loop is possible of course, but 
> what should the result be? If I have a sessionStorage object |s| with 10 
> items, the length will be 10. Should I expect |s[i]| for i=0,..., 9?  
> If so what will be the result, keys? items? Can I set values, eg s[2] = 
> "howdy"?


# The object's indices of the supported indexed properties are the numbers 
# in the range zero to one less than the number of key/value pairs 
# currently present in the list associated with the object.

>From the IDL:
# [IndexGetter] DOMString key(in unsigned long index);

# The key(n) method must return the name of the nth key in the list.

See WebIDL for the definition of the [IndexGetter] syntax.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 28 April 2009 23:06:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:12:53 UTC