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**** >
