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

Re: Storage 'length' and enumeration

From: Sean Hogan <shogun70@westnet.com.au>
Date: Thu, 30 Apr 2009 08:45:42 +1000
Message-ID: <49F8D896.4060408@westnet.com.au>
To: Ian Hickson <ian@hixie.ch>
CC: "John J. Barton" <johnjbarton@johnjbarton.com>, public-webapps@w3.org
Ian Hickson wrote:
> On Tue, 28 Apr 2009, John J. Barton wrote:
>   
>> I could not figure out from the WebIDL what happens in this case:
>>    sessionStore[2] = "howdy"; // no other keys in sessionStore
>>
>> I guess this does not work like Javascript arrays or objects, rather I 
>> expect it fails?
>>     
>
> It works, it just sets the key "2" to the value "howdy".
>
> (Modulo some WebIDL and WebStorage IDL bugs that I will report 
> separately, oops.)
>
>   
sessionStore[2] = "howdy";
print(sessionStore[2]); // prints null?
print(sessionStore["2"]); // prints "howdy"

To my knowledge that's not consistent with any other object or interface 
in the browser.

Sean
Received on Wednesday, 29 April 2009 22:47:19 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:31 GMT