W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2009

[whatwg] localStorage feedback

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 13 Oct 2009 23:28:05 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0910132326170.6803@hixie.dreamhostps.com>
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.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 13 October 2009 16:28:05 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:18 UTC