[dojo-contributors] Re: dojo.lang.isUndefined()

Scott J. Miles sjmiles at turboajax.com
Thu Jun 29 19:22:26 EDT 2006


>> Well, it's not possible to write a function that tests whether a global
is defined or not (unless you check [the name as string] as a property of
global object). That's what dj_undef does isn't it? <<

Yes, that's much clearer, I wish I'd just said that in the first place.
That's exactly what dj_undef does. 

dj_undef("foo"); // tests window["foo"] 
dj_undef("foo", obj); // tests obj["foo"]

Also, I thought I'd mention that dj_undef doesn't come up much if one is in
the habit of namespacing application code. 

Regards,
Scott J. Miles
TurboAjax Group
http://www.turboajax.com

-----Original Message-----
From: dojo-contributors-bounces at dojotoolkit.org
[mailto:dojo-contributors-bounces at dojotoolkit.org] On Behalf Of Bob Ippolito
Sent: Thursday, June 29, 2006 3:46 PM
To: dojo dev.; Alex Russell
Cc: Aaron Boodman
Subject: Re: [dojo-contributors] Re: dojo.lang.isUndefined()


On Jun 29, 2006, at 2:55 PM, Alex Russell wrote:

> On Thursday 29 June 2006 12:15 pm, Aaron Boodman wrote:
>> Also, in Firefox this will raise a warning in the JS console if 
>> strict mode is enabled.
>
> Firefox's console is nearly useless these days. They really screwed up 
> by logging CSS "errors". Thank god for Firebug.
>
>> I just stopped writing code like this and used the typeof test 
>> directly each time. :-/
>
> Gah. That seems like giving up in the wrong place to me.

Well, it's not possible to write a function that tests whether a global is
defined or not (unless you check them as properties of global object).
That's what dj_undef does isn't it?

-bob

_______________________________________________
dojo-contributors mailing list
dojo-contributors at dojotoolkit.org
http://dojotoolkit.org/mailman/listinfo/dojo-contributors




More information about the dojo-contributors mailing list