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

Boris Zbarsky bzbarsky at MIT.EDU
Wed Aug 12 10:22:09 PDT 2009


Jeremy Orlow wrote:
>      > and, when passed value is undefined (e.g. `setItem("key")`), which
>      > behavior will be correct?
...

> 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.

Given the actual example code (and not its description, which doesn't 
match the code), the relevant section is 
http://dev.w3.org/2006/webapi/WebIDL/#es-operations steps 1 through 3 in 
the third bullet point.

It looks to me like per the current spec text that will throw a 
TypeError for the above call, unless the second argument to setItem is 
marked [optional].

-Boris


More information about the whatwg mailing list