W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

[indexeddb] openCursor optional parameters issue

From: Israel Hilerio <israelh@microsoft.com>
Date: Mon, 27 Jun 2011 18:42:14 +0000
To: "public-webapps@w3.org" <public-webapps@w3.org>
CC: Adam Herchenroether <aherchen@microsoft.com>, Victor Ngo <vicngo@microsoft.com>
Message-ID: <F695AF7AA77CC745A271AD0F61BBC61E3D17AA35@TK5EX14MBXC119.redmond.corp.microsoft.com>
The IDBObjectStore.openCursor method is defined to have two optional parameters:
* IDBRequest openCursor (in optional any range, in optional unsigned short direction) raises (IDBDatabaseException);

Based on the examples in the spec, it seems we're envisioning the method to be used in the following ways:
* objStore.openCursor();
* objStore.openCursor(keyRange);
* objStore.openCursor(keyRange, IDBCursor.PREV);
* objStore.openCursor(IDBCursor.PREV);

Having "any" for the keyRange type makes it difficult to detect the correct overloaded parameter for openCursor.

In looking at IDBIndex.openCursor the range parameter has a different type, IDBKeyRange.  This seems to be the correct type we should be using in IDBObjectStore.openCursor:
* IDBRequest openCursor (in optional IDBKeyRange range, in optional unsigned short direction) raises (IDBDatabaseException);

If you agree, I can work with Eliot to make this change in the spec.

Received on Monday, 27 June 2011 18:43:06 UTC

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