Thanks for the tip, Steven - any info as to why? If the error is
thrown, the function returns; if it isn't thrown, the function
returns. Is this just 'good practice' - if so, instead of blindly
following dogma, I'd like a little insight as to _why_ it's good
practice?

(I've had issues like this in the past where it turns out the 'good
practice' evolved because of a specific implementation bug in an early
C++ compiler, rather than because it was actually good practice for
the language I was using at the time.)

Ian

On Wed, Oct 29, 2008 at 2:20 AM, Steven Sacks <[EMAIL PROTECTED]> wrote:
> Do not call return in a try catch.
>
>
> Ian Thomas wrote:
>>
>> Method:
>>
>>    public static function refExists(obj:Object,name:String):Boolean
>>    {
>>        try
>>        {
>>            if (obj[name]!=null)
>>                return true;
>>        }
>>        catch (e:ReferenceError) {}
>>        return false;
>>    }
>>
>> HTH,
>>   Ian
>>
>> On Tue, Oct 28, 2008 at 8:36 AM, Ian Thomas <[EMAIL PROTECTED]> wrote:
>>>
>>> Or, thinking about it, you could catch the reference error in a
>>> try/catch block. It's more of a kludge, but might give you much higher
>>> performance!
>>>
>>> Ian
>>>
>> _______________________________________________
>> Flashcoders mailing list
>> [email protected]
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to