On 23-Jun-06, at 1:14 PM, Bob Ippolito wrote:
>> By the way, any reason we're using:
>> try {
>> if (typeof(MochiKit.Base) == 'undefined') {
>> throw '';
>> }
>> } catch (e) {
>> throw 'MochiKit.Style depends on MochiKit.Base!';
>> }
>>
>> Instead of something like:
>> if (typeof(MochiKit.Base) == 'undefined') {
>> throw 'MochiKit.Style depends on MochiKit.Base!';
>> }
>
> If the MochiKit object doesn't exist, typeof(MochiKit.Base) will
> throw a NameError.
How about something like this instead:
if (typeof(MochiKit) == 'undefined') {
throw 'MochiKit.Signal depends on MochiKit!';
} else {
if (typeof(MochiKit.DOM) == 'undefined') {
throw 'MochiKit.Signal depends on MochiKit.DOM!';
}
if (typeof(MochiKit.Style) == 'undefined') {
throw 'MochiKit.Signal depends on MochiKit.Style!';
}
}
Or:
if (typeof(MochiKit) == 'undefined' ||
typeof(MochiKit.DOM) == 'undefined') {
throw 'MochiKit.Signal depends on MochiKit.DOM!';
}
if (typeof(MochiKit) == 'undefined' ||
typeof(MochiKit.Style) == 'undefined') {
throw 'MochiKit.Signal depends on MochiKit.Style!';
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---