Re: [indexeddb] Handing negative parameters for the advance method

On Fri, Aug 12, 2011 at 2:34 PM, Israel Hilerio <israelh@microsoft.com> wrote:
> Since advance is intended to always move the cursor forward, it seems we want to only support positive parameter values.  Therefore, I would suggest we change its signature to:
>
> void advance (in unsigned int count);
>
> If a developer specifies a negative number for it, we could throw an IDBDatabaseException with a value of NON_TRANSIENT_ERR.  A value of zero will do nothing.
>
> I also noticed that the webIDL spec doesn't define int or unsigned int.  It seems we should be using long (for int) and unsigned long (unsigned int).
>
> Do you agree?

Yup. Though I think WebIDL will take care of the handling for when the
author specifies a negative value. I.e. WebIDL will specify what
exception to throw, so we don't need to. Similar to how WebIDL
specifies what exception to throw if the author specifies too few
parameters, or parameters of the wrong type.

/ Jonas

Received on Friday, 12 August 2011 22:17:37 UTC