Closed Bug 644436 Opened 13 years ago Closed 13 years ago

IDBDatabase createObjectStore keyPath/autoIncrement object argument

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows 7
defect
Not set
minor

Tracking

()

RESOLVED INVALID

People

(Reporter: michael.putters, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: 4.0

createObjectStore normally takes three arguments, two of which are optional, as described here:

http://www.w3.org/TR/IndexedDB/#widl-IDBDatabase-createObjectStore
https://developer.mozilla.org/en/IndexedDB/IDBDatabase#createObjectStore

However, with the current implementation, the second and third arguments (keyPath and autoIncrement) have to be passed together as a single argument; this doesn't work (but should, I believe, according to the specs):

db.createObjectStore('person','id',true);

Error: uncaught exception: [Exception... "This error occurred because an operation was not allowed on an object. A retry of the same operation would fail unless the cause of the error is corrected."  code: "2" nsresult: "0x80660002 (NS_ERROR_DOM_INDEXEDDB_NON_TRANSIENT_ERR)"]

This, on the other hand, works:

db.createObjectStore('person',{keyPath:'id',autoIncrement:true});


The MDC documentation is similar to the specs while the indexedDB primer (https://developer.mozilla.org/en/IndexedDB/IndexedDB_primer) follows the implementation.

Reproducible: Always

Steps to Reproduce:
During a version update event on an IDBDatabase:
db.createObjectStore('person','id',true);
Actual Results:  
Error: uncaught exception: [Exception... "This error occurred because an operation was not allowed on an object. A retry of the same operation would fail unless the cause of the error is corrected."  code: "2" nsresult: "0x80660002 (NS_ERROR_DOM_INDEXEDDB_NON_TRANSIENT_ERR)"]

Expected Results:  
Same as db.createObjectStore('person',{keyPath:'id',autoIncrement:true});
Hardware: x86_64 → x86
Version: unspecified → Trunk
The spec has been updated, but the updates haven't been published yet. You can look at the latest editor drafts here:

http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.