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

Jonas Sicking jonas at sicking.cc
Tue Apr 14 13:41:04 PDT 2009


On Tue, Apr 14, 2009 at 10:54 AM, Patrick Mueller
<pmuellr at muellerware.org> wrote:
> 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.

As I understand it, the web already depends on this behavior. IIRC
EcmaScript 3.1 is going to mandate this behavior, so it'll be specced
behavior soon.

/ Jonas



More information about the whatwg mailing list