This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The spec sayeth: createIndex: "If an index with the same name already exists, the implementation must throw a DOMException of type ConstraintError." "An index with the same name, compared in a case-sensitive manner, already exists in the connected database." deleteIndex: "This method destroys the index with the given name in the connected database." "There is no index with the given name, compared in a case-sensitive manner, in the connected database." This would appear to require that this should throw ConstraintError: mozIndexedDB.open("my-db", 1).onupgradeneeded = function(e) { db = e.target.result; s1 = db.createObjectStore('s1'); s2 = db.createObjectStore('s2'); s1.createIndex('i', 'keypath'); s2.createIndex('i', 'keypath'); }; I don't believe this is the intention of the spec, and neither Firefox (14) nor Chrome (20) behave this way. The uniqueness constraint for index names should be just is within an object store, not across the database. It looks like this is just a copy/pasta from the description/exception tables for create/deleteObjectStore.
I'll make the change like this: createIndex: "If an index with the name already exists, the implementation must throw a DOMException of type ConstraintError." "An index with the same name, compared in a case-sensitive manner, already exists in the connected object store." deleteIndex: "This method destroys the index with the given name in the connected object store." "There is no index with the given name, compared in a case-sensitive manner, in the connected object store." Thanks, E
Looks good, although you can probably remove the word "connected". I think that's there from implying the distinction between the IDBDatabase (the "connection") and the database itself.
Changes incorporated in commit #377.