Harbs commented on issue #900:
URL: https://github.com/apache/royale-asjs/issues/900#issuecomment-680802411


   This is almost certainly due to the array being strings instead of numbers. 
I believe the fix is simple, but I don't have time to test.
   
   Language.as has the following function:
   ````
           private static function compareAsNumber(a:Object, b:Object):int
           {
               if (a > b)
               {
                   return muler;
               } else if (a < b)
               {
                   return -muler;
               }
               return 0;
           }
   ````
   
   Making the following change should fix this issue:
   ````
           private static function compareAsNumber(a:Object, b:Object):int
           {
               a = +a;
               b = +b;
               if (a > b)
               {
                   return muler;
               } else if (a < b)
               {
                   return -muler;
               }
               return 0;
           }
   ````
   Can you test and create a PR if it fixes it?
   
   Thanks!
   Harbs


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to