flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Dufilie (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLEX-34987) Parentheses are lost around ternary operator
Date Fri, 11 Dec 2015 06:03:10 GMT
Andy Dufilie created FLEX-34987:
-----------------------------------

             Summary: Parentheses are lost around ternary operator
                 Key: FLEX-34987
                 URL: https://issues.apache.org/jira/browse/FLEX-34987
             Project: Apache Flex
          Issue Type: Bug
          Components: Falcon, FlexJS
    Affects Versions: Apache FlexJS 0.5.0
            Reporter: Andy Dufilie


Example code:
{code}
public static function getTestString(a:Number, b:Number):String
{
	return "a " + (a < b ? "<" : ">=") + " b";
}
{code}

Incorrectly cross-compiled:
{code}
TestClass.getTestString = function(a, b) {
  return "a " + a < b ? "<" : ">=" + " b";
};
{code}

Because the parentheses are lost, the function will always return ">= b".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message