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

Re: IndexedDB: undefined parameters

From: Robert Ginda <rginda@chromium.org>
Date: Tue, 9 Oct 2012 15:18:52 -0700
Message-ID: <CA+SC+VqdVbpVcxvToCbR86kKBH4zaWbSFtT2EbmyDrXYk70=Mw@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: Alec Flett <alecflett@chromium.org>, public-webapps <public-webapps@w3.org>
On Tue, Oct 9, 2012 at 3:11 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 10/9/12 6:04 PM, Robert Ginda wrote:
>
>> But I never, ever use the symbol-known-as
>> "undefined" in script, since it's actually a write-able variable.
>>
>
> For what it's worth, it's not anymore.  It used to be, but current ES
> makes it a readonly non-configurable property of the global.  Not sure to
> what extent UAs have caught up with the spec on that.
>
>
Oh, I wasn't aware of that.  I'd still avoid using undefined values to mean
"I intentionally don't want to provide a value".  Null is more trustworthy
for that, because it's not going to show up "on accident".  In my own
private coding guidelines in my head, I only *test* for undefined.  It only
appears as an rvalue in very rare cases, and when it does it appears as
"(void 0)".

Of course in cases like this:
>
>   function foo(undefined) {
>     // Code using "undefined" here loses
>   }
>
> you still have a problem....
>
>
>  I'd suggest also treating null as missing if possible.
>>
>
> In general, or for the specific IDB case?


Well my own personal opinion would be in general, but I don't know what
kind of repercussions that would have on other specifications and
implementations.


Rob.


>
>
> -Boris
>
>
Received on Tuesday, 9 October 2012 22:19:41 GMT

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