[whatwg] question about Web Storage setItem()'s behavior

Jeremy Orlow jorlow at chromium.org
Wed Aug 12 09:58:40 PDT 2009


On Wed, Aug 12, 2009 at 1:34 AM, Ian Hickson <ian at hixie.ch> wrote:

> On Wed, 12 Aug 2009, į~Y―į~_ģäŋ~Jåđģ wrote:
> >
> > and, when passed value is undefined (e.g. `setItem("key")`), which
> > behavior will be correct?
> > On current implementation of browsers, I looked as follows.
> > - IE and Firefox raise error, (arguments number is incorrect)
> > - Webkit family persist it as string ("undefined")
>
> I believe WebIDL says that a TypeError exception should be thrown, but it
> was not immediately obvious to me how to derive this from the spec.


I believe this is the correct section of the spec to be looking at:
http://dev.w3.org/2006/webapi/WebIDL/#es-DOMString
If so, I think it's pretty clear that Safari's implementation is correct on
this issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090812/958a83ef/attachment-0001.htm>


More information about the whatwg mailing list