[whatwg] localStorage feedback

Ian Hickson ian at hixie.ch
Tue Oct 13 16:28:05 PDT 2009


On Tue, 13 Oct 2009, Jeremy Orlow wrote:
> On Tue, Oct 13, 2009 at 3:40 PM, Ian Hickson <ian at hixie.ch> wrote:
> > On Tue, 13 Oct 2009, Brett Cannon wrote:
> > > On Mon, Oct 12, 2009 at 19:07, Ian Hickson <ian at hixie.ch> wrote:
> > > >
> > > > I believe you can test if a key is in the storage area using:
> > > >
> > > >   if (key in storage) { ... }
> > > >
> > > > For example:
> > > >
> > > >   if ('document' in window.localStorage) { ... }
> > >
> > > I didn't find that in the spec anywhere. Is it somehow implicit and I
> > > just missed it? Or will it be specified sometime in the future?
> >
> > It's the net effect of this line in the spec:
> >
> > # The names of the supported named properties on a Storage object are the
> > # keys of each key/value pair currently present in the list associated
> > # with the object.
> >
> > ...combined with the definitions in the WebIDL spec.
> 
> It seems odd that there wouldn't be a corresponding method on 
> localStorage given that the deleter, getter, and setter all have them.

Personally I'd rather remove those methods, but I think we're stuck with 
them at this point.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list