Re: [Bug 12111] spec for Storage object getItem(key) method does not match implementation behavior

Hixie, All - PLH proposed a fix for this bug in comment #5 (use 
DOMString instead of any in {get,set}Item).

AFAIU, PLH's proposal matches what has been widely implemented. As such, 
it seems like the spec should be updated accordingly.

-AB

On Jun/2/2011 8:31 AM, ext bugzilla@jessica.w3.org wrote:
> http://www.w3.org/Bugs/Public/show_bug.cgi?id=12111
>
> --- Comment #5 from Philippe Le Hegaret<plh@w3.org>  2011-06-02 12:31:42 UTC ---
> here is how the change should look like I think:
>
> [[
>
> interface Storage {
>    [...]
>    getter DOMString getItem(in DOMString key);
>    setter creator void setItem(in DOMString key, in DOMString value);
>    [...]
> };
>
> [...]
>
> The getItem(key) method must return the current value associated with the given
> key. If the given key does not exist in the list associated with the object
> then this method must return null.
>
> The setItem(key, value) method must set the value of a given key. If this
> raises an exception, then the exception must be thrown and the previous value
> associated with the given key is left unchanged.
>
> ]]
>
> For forward compatibility purposes, I would not change the types of oldValue
> and newValue in the StorageEvent interface. In practice, those will be
> DOMString since that's the only thing one can store, but this could change in
> the future if we add a getValue and a setValue methods to the Storage interface
> with the type any.
>

Received on Thursday, 2 June 2011 13:02:13 UTC