flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Harui (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (FLEX-35114) static constants in constructor don't compile correctly
Date Tue, 15 Nov 2016 18:06:58 GMT

     [ https://issues.apache.org/jira/browse/FLEX-35114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alex Harui resolved FLEX-35114.
-------------------------------
    Resolution: Fixed

a3abbdb14f49b695c113e61de27d1dcc608de97c

> static constants in constructor don't compile correctly
> -------------------------------------------------------
>
>                 Key: FLEX-35114
>                 URL: https://issues.apache.org/jira/browse/FLEX-35114
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: FalconJX
>            Reporter: Harbs
>            Assignee: Alex Harui
>
> {code:actionscript}
> package
> {
> 	public class Dummy
> 	{
> 		public static const NAME:String = "Dummy";
> 		public function Dummy(myName:String=NAME)
> 		{
> 			_name = myName;
> 		}
> 		private var _name:String;
> 	}
> }
> {code}
> The constructor compiles to this:
> {code:javascript}
> /**
>  * @constructor
>  * @param {string=} myName
>  */
> Dummy = function(myName) {
>   myName = typeof myName !== 'undefined' ? myName : NAME;
>   this._name = myName;
> };
> /**
>  * @export
>  * @const
>  * @type {string}
>  */
> Dummy.NAME = "Dummy";
> {code}
> When trying to instantiate, you'll get an error NAME is undefined.
> It should be this instead:
> {code:javascript}
>   myName = typeof myName !== 'undefined' ? myName : Dummy.NAME;
> {code}



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

Mime
View raw message