joshtynjala commented on issue #179:
URL: https://github.com/apache/royale-compiler/issues/179#issuecomment-827118809


   I have confirmed that this is a bug in the compiler.
   
   On initial investigation, it seems to be directly related to the code that 
re-writes AS3 Date properties like fullYear/month/date to their JS function 
equivalents like getFullYear()/getMonth()/getDate(). In the expanded example 
below, the original parentheses are present in the generated JS when calling 
the getFullYear() method, and also when accessing the length property on a 
String.
   
   ```as3
   var string1 : String;
   var foo1 : Date;
   string1 = (foo1.fullYear + 1).toString();
   
   var string2 : String;
   var foo2 : Date;
   string2 = (foo2.getFullYear() + 1).toString();
   
   var string3 : String;
   var foo3 : String;
   string3 = (foo3.length + 1).toString();
   ```
   
   JS:
   
   ```js
   var /** @type {string} */ string1 = null;
   var /** @type {Date} */ foo1 = null;
   var /** @type {string} */ string2 = null;
   var /** @type {Date} */ foo2 = null;
   var /** @type {string} */ string3 = null;
   var /** @type {string} */ foo3 = null;
   //var /** @type {string} */ string1 = null;
   //var /** @type {Date} */ foo1 = null;
   string1 = foo1.getFullYear() + 1.toString();
   string2 = (foo2.getFullYear() + 1).toString();
   string3 = (foo3.length + 1).toString();
   ```


-- 
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:
us...@infra.apache.org


Reply via email to