W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2010

Re: [IndexedDB] Behavior of IDBObjectStore.get() and IDBObjectStore.delete() when record doesn't exist

From: Jeremy Orlow <jorlow@chromium.org>
Date: Thu, 11 Nov 2010 22:44:03 +0300
Message-ID: <AANLkTinBE7aPFaVYpWNvUNJfmprDF8D5YksM8a8PxMUX@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Keean Schupke <keean@fry-it.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, Webapps WG <public-webapps@w3.org>
The email I responded to: "It would make sense if you make setting a key to
undefined semantically equivalent to deleting the value (and no error if it
does not exist), and return undefined on a get when no such key exists. That
way 'undefined' cannot exist as a value in the object store, and is a safe
marker for the key not existing in that index."

undefined should be symmetric.  If something not existing returns undefined
then passing in undefined should make it not exist.  Overloading the meaning
of a get returning undefined is ugly.  And simply disallowing a value also
seems a bit odd.  But I think this is pretty elegant semantically.

J

On Thu, Nov 11, 2010 at 7:04 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> On Thu, Nov 11, 2010 at 4:26 AM, Jeremy Orlow <jorlow@chromium.org> wrote:
> > I really like this idea.  I only skimmed the arguments against it, but
> they
> > all seemed pretty hand-wavy to me.
>
> Which idea specifically do you like?
>
> / Jonas
>
Received on Thursday, 11 November 2010 19:44:55 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:41 GMT