On Mon, Nov 8, 2010 at 2:12 PM, <[email protected]> wrote: > http://www.w3.org/Bugs/Public/show_bug.cgi?id=11257 > > Summary: Should IDBCursor.update be able to create a new entry? > Product: WebAppsWG > Version: unspecified > Platform: PC > OS/Version: All > Status: NEW > Severity: normal > Priority: P2 > Component: Indexed Database API > AssignedTo: [email protected] > ReportedBy: [email protected] > QAContact: [email protected] > CC: [email protected], [email protected] > > > What should happen in the following case: > > db.transaction(["foo"]).objectStore("foo").openCursor().onsuccess = > function(e) > { > var cursor = e.result; > if (!cursor) > return; > > cursor.delete(); > cursor.update({ id: 1234, value: "Benny" }); > } > > > This situation can of course arrive in more subtle ways: > > os = db.transaction(["foo"]).objectStore("foo"); > os.openCursor().onsuccess = function(e) { > var cursor = e.result; > if (!cursor) > return; > > cursor.update({ id: 1234, value: "Benny" }); > } > os.delete(1234); > > > As specified, IDBCursor.update behaves just like IDBObjectStore.put and > just > creates a new entry, but this might be somewhat unexpected behavior. >
Let's just remove update and delete from IDBCursor and be done with it. J
