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

[whatwg] localStorage feedback

From: Jeremy Orlow <jorlow@chromium.org>
Date: Tue, 13 Oct 2009 15:53:14 -0700
Message-ID: <5dd9e5c50910131553gaa47fc6s65d2e3a1ed0413ef@mail.gmail.com>
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.

Of course, adding a new keyword would break backwards compatibility.  (Yet
another shortcoming of local storage.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20091013/e078957c/attachment.htm>
Received on Tuesday, 13 October 2009 15:53:14 UTC

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