[ 
https://issues.apache.org/jira/browse/FLEX-35283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15934945#comment-15934945
 ] 

Greg Dove commented on FLEX-35283:
----------------------------------

Just a quick followup: There is a difference in the outputs from GCC between 
using 0 and undefined in the place of the optional radix arg. 
Using 0 as the radix outputs 0 as the radix in the release code. This works, as 
expected. 
Using undefined outputs 'void 0' in place of undefined as the 'radix'. This 
also works as expected, and I believe this is a performance optimization (based 
on some simple checks in chrome using a fork of someone's jsfiddle for testing 
this type of stuff [1])
This might be why GCC has the explicit recommendation to use undefined (which 
is converted to 'void 0' in release output, perhaps in many/most cases wherever 
undefined is used). If we follow GCC spec for this, then if they change things 
later in terms of what optimizations apply for this scenario, we should pick up 
on their improvements, which may not happen if we use 0 here. There could be a 
case for '0' being more 'readable' in the js output, but we're adding something 
that was not there in the original code, so people have to deal with that part 
anyway, and for an optional arg, adding 'undefined' arguably is more 
descriptive than 0, I think, compared to the original source. 
[~aharui]  What are your thoughts?  It's a small change either way- currently I 
am planning to change jx to use undefined end of day (local time) and update 
any test(s). Let me know if you disagree with the above.

1. http://jsfiddle.net/343ax554/

> parseInt Implementation
> -----------------------
>
>                 Key: FLEX-35283
>                 URL: https://issues.apache.org/jira/browse/FLEX-35283
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: FalconJX
>    Affects Versions: Apache FalconJX 0.8.0
>            Reporter: Greg Dove
>            Assignee: Greg Dove
>
> parseInt does not correctly process hex strings without no second parameter
> parseInt("0x99")
> this should calculate as 153
> it is currently compiled to 
> parseInt("0x99",10)
> in js which evaluates to 0



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to