W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: [indexeddb] Exception type for NON_TRANSIENT_ERR code

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 3 Oct 2011 20:10:13 -0700
Message-ID: <CA+c2ei8hSywud-YBBerHKCeYXmtTcU0FpzXSO_0f01g9MRYnow@mail.gmail.com>
To: Israel Hilerio <israelh@microsoft.com>
Cc: "public-webapps@w3.org" <public-webapps@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:48 GMT