<div class="gmail_quote">On Tue, Oct 13, 2009 at 3:40 PM, Ian Hickson <span dir="ltr"><<a href="mailto:ian@hixie.ch">ian@hixie.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, 13 Oct 2009, Brett Cannon wrote:<br>
> On Mon, Oct 12, 2009 at 19:07, Ian Hickson <<a href="mailto:ian@hixie.ch">ian@hixie.ch</a>> wrote:<br>
> ><br>
</div><div class="im">> > I believe you can test if a key is in the storage area using:<br>
> ><br>
> > if (key in storage) { ... }<br>
> ><br>
> > For example:<br>
> ><br>
> > if ('document' in window.localStorage) { ... }<br>
><br>
> I didn't find that in the spec anywhere. Is it somehow implicit and I<br>
> just missed it? Or will it be specified sometime in the future?<br>
<br>
</div>It's the net effect of this line in the spec:<br>
<br>
# The names of the supported named properties on a Storage object are the<br>
# keys of each key/value pair currently present in the list associated<br>
# with the object.<br>
<br>
...combined with the definitions in the WebIDL spec.<br></blockquote><div><br></div><div>It seems odd that there wouldn't be a corresponding method on localStorage given that the deleter, getter, and setter all have them.</div>
<div><br></div><div>Of course, adding a new keyword would break backwards compatibility. (Yet another shortcoming of local storage.)</div></div>