[whatwg] native ordered dictionary data type in web storage draft

James Graham wrote:
> Aryeh Gregor wrote:
>> On Tue, Apr 14, 2009 at 10:18 AM, Patrick Mueller
>> <pmuellr at muellerware.org> wrote:
>>> This is the first time I've seen the requirement for such a beast.  
>>> You can
>>> understand the desire for it, given the context, but still.  Does 
>>> anything
>>> else in JavaScript make use of such a data structure?
>>
>> It says that JavaScript should just use Object.  Isn't that,
>> essentially, an ordered dictionary?
> 
> Yes. Indeed there are compatibility requirements for the ordering of 
> ordinary user-created Object Objects in web browser implementations; the 
> order of enumeration must be the same as the order of insertion of the 
> properties.

Interesting.  I guess this is a "JavaScript in web browser 
implementation" difference from the "JavaScript spec".  Following the 
links in jresig's blog post

    http://ejohn.org/blog/javascript-in-chrome/

in the "for loop order" section.

Still doesn't seem like it makes sense to go ahead and build 
dependencies on this (unfortunate, IMO) behavior.

-- 
Patrick Mueller

Received on Tuesday, 14 April 2009 10:54:15 UTC