W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Re: IndexedDB: Extra properties in optionalParameters objects

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 24 Jan 2012 14:45:00 -0800
Message-ID: <CA+c2ei8eUWhTxbAOsXUuDXn8V5rX+xJj_-VcV-sfK3OeL6Cu_Q@mail.gmail.com>
To: Joshua Bell <jsbell@chromium.org>
Cc: public-webapps@w3.org
On Tue, Jan 24, 2012 at 2:36 PM, Joshua Bell <jsbell@chromium.org> wrote:
> I noticed a test regarding optional parameters
> on http://samples.msdn.microsoft.com/ietestcenter/#indexeddb that IE10PP4
> and Chrome 15 are marked as failing and Firefox 8 is marked as passing. (I
> have Chrome 18 and FF9 handy - no changes.)
> The specific test is "IDBDatabase.createObjectStore() - attempt to create an
> object store with an invalid optional parameter"
> at http://samples.msdn.microsoft.com/ietestcenter/indexeddb/indexeddb_harness.htm?url=idbdatabase_createObjectStore7.htm and
> the actual JavaScript code that's being tested:
> objStore = db.createObjectStore(objectStoreName, { parameter: 0 });
> By my reading of the IDB and WebIDL specs, the optionalParameters parameter
> is a WebIDL dictionary
> (http://www.w3.org/TR/IndexedDB/#options-object-concept). The ECMAScript
> binding algorithm for WebIDL dictionaries
> (http://www.w3.org/TR/WebIDL/#es-dictionary) is such that the members
> expected in the IDL dictionary are read out of the ECMAScript object, but
> the properties of the ECMAScript object itself are never enumerated and
> therefore "extra" properties should be ignored. Therefore, the "parameter"
> property in the test code would be ignored, and this would be treated the
> same as db.createObjectStore(name, {}) which should not produce an error.
> So I would consider the IE10 and Chrome behavior correct, and the test
> itself and Firefox behavior incorrect.
> Thoughts?

Yup. We made this change in the spec a while ago (I was the one who
was pushing for the throwing behavior, but eventually gave in). The
change was made by switching to using WebIDL dictionaries which behave
exactly as you describe.

This has also been fixed in newer versions of Firefox. This is fixed
in Firefox 10 which will be released very soon (a week or two).

/ Jonas
Received on Tuesday, 24 January 2012 22:45:59 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:38 UTC