You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Alex Harui (JIRA)" <ji...@apache.org> on 2015/12/21 21:04:46 UTC

[jira] [Assigned] (FLEX-34986) const class member variables get initialized incorrectly

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

Alex Harui reassigned FLEX-34986:
---------------------------------

    Assignee: Alex Harui

> const class member variables get initialized incorrectly
> --------------------------------------------------------
>
>                 Key: FLEX-34986
>                 URL: https://issues.apache.org/jira/browse/FLEX-34986
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Falcon, FlexJS
>    Affects Versions: Apache FlexJS 0.5.0
>            Reporter: Andy Dufilie
>            Assignee: Alex Harui
>
> {{const}} class members should be initialized the same way that {{var}} members get initialized.  As it is now, {{const}} member variables are initialized as if they were static.
> Example code:
> {code}
> public class TestClass
> {
> 	public function TestClass(value:String)
> 	{
> 		myConst.prop = value;
> 		myVar.prop = value;
> 	}
> 	public const myConst:Object = {};
> 	public var myVar:Object = {};
> }
> {code}
> Incorrectly cross-compiled:
> {code}
> TestClass = function(value) {
>   
>   this.myVar = {};
>   this.myConst.prop = value;
>   this.myVar.prop = value;
> };
> TestClass.prototype.myConst = {};
> TestClass.prototype.myVar;
> {code}
> Expected correct result:
> {code}
> TestClass = function(value) {
>   this.myConst = {};
>   this.myVar = {};
>   this.myConst.prop = value;
>   this.myVar.prop = value;
> };
> TestClass.prototype.myConst;
> TestClass.prototype.myVar;
> {code}



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