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

Re: [indexeddb] What should happen when specifying the wrong "mode" or "direction"?

From: Jonas Sicking <jonas@sicking.cc>
Date: Sat, 3 Mar 2012 02:56:50 +0100
Message-ID: <CA+c2ei_quOQv6Y=n+W1AJUVatz1K3ujmBmHTNOq-c4=ST2JHLQ@mail.gmail.com>
To: Israel Hilerio <israelh@microsoft.com>
Cc: "public-webapps@w3.org" <public-webapps@w3.org>, Victor Ngo <vicngo@microsoft.com>
During my recent editing of the spec I noticed the same issue.

It appears that it was clearly defined that an invalid "mode" parameter
should throw a TypeError, but no behaviour was defined for invalid
"direction" parameters.

I fixed this by specifying that invalid "direction" parameters should also
throw a TypeError.

(I mention this at the end I my long "Finalizing error handling" email.)

So this should already be taken care of in that latest editor drafts.

If anyone disagrees with this solution, or if I missed anyplace in the
spec, please speak up.

To be clear, I would not be surprised if Firefox does not currently handle
this correctly, per any particular version of the spec.

/ Jonas

On Saturday, March 3, 2012, Israel Hilerio wrote:

>  We need to define in the spec what should happen if a developers defines
> an invalid “mode” or “direction”.  Do we throw a TypeError Exception or
> revert to defauls?****
> ** **
> FF seems to allow this behavior and reverts back to a readOnly transaction
> mode and a direction of next, respectively:****
> * db.transaction( objectStoreList, “invalidMode”) ===  db.transaction(
> objectStoreList)****
> * o.openCursor(keyRange, “invalidDirection”) === o.openCursor(keyRange)***
> *
> ** **
> We’re okay with this behavior if everyone else agrees.****
> ** **
> Israel****
Received on Saturday, 3 March 2012 01:57:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:31 UTC