flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: [4/6] git commit: [flex-sdk] [refs/heads/develop] - FLEX-24296 throw out of range error if passed negative index
Date Sat, 11 May 2013 15:51:53 GMT
Like it!


On 5/10/13 11:45 PM, "Justin Mclean" <justin@classsoftware.com> wrote:

> Hi,
> 
>> Like I said, probably not worth your time.  The overhead of proxy is known
>> to be pretty high.
> 
> Looking at the code I'm not even sure what the try catch is in there as there
> nothing that can throw an exception.
> 
> It probably could be simplified to (it may even be faster).
> 
>     override flash_proxy function getProperty(name:*):*
>     {
>         if (name is QName)
>             name = name.localName;
> 
>         var n:Number = parseInt(String(name));
> 
> if (isNaN(n))
>         {
>             message = resourceManager.getString(
>                 "collections", "unknownProperty", [ name ]);
>             throw new Error(message);
>         }
>         else
>         {
>    // If caller passed in a number such as 5.5, it will be floored.
>             return getItemAt(int(n));
>         }
>     }
> 
> getItemAt with throw correct exception if n < 0
> 
> Justin

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Mime
View raw message