Re: [indexeddb] Exception type for NON_TRANSIENT_ERR code

On Mon, Oct 3, 2011 at 7:17 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> IDBDatabase(Sync).createObjectStore if the options argument is handed
> an object with properties other than those in the dictionary.
>  This doesn't actually match how dictionaries are supposed to behave
> per WebIDL. They are defined to ignore all properties not defined by
> the dictionary IDL. So we should remove this exception and also change
> the type of this argument to use "IDBDatabaseOptionalParameters"
> rather than "Object".

Oh, and I should mention that I was the one originally pushing for the
throwing behavior here. However I was talked out of it by various
people that know JS better than me, both on this list and elsewhere.
The short answer is that looking for absence of properties any isn't a
very "JS-esq" thing to do. First of all properties often live on
prototype chains. For example every object has a "toString" property
since that property lives on the Object prototype.

So that's why the WebIDL spec doesn't throw for unknown properties,
and that's why I was talked out of it for IndexedDB too.

/ Jonas

Received on Tuesday, 4 October 2011 03:11:10 UTC