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-34986) const class member variables get initialized incorrectly
Date Fri, 11 Dec 2015 05:54:10 GMT
Andy Dufilie created FLEX-34986:
-----------------------------------

             Summary: 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


{{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)

Mime
View raw message