royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yishay Weiss <>
Subject RE: MXML attributes, minification, and initialization
Date Tue, 05 Dec 2017 09:41:00 GMT
When I change MyComp to have get/set the result is the following added line, which probably
protects the public interface.


From: Yishay Weiss <>
Sent: Tuesday, December 5, 2017 11:00:40 AM
Subject: RE: MXML attributes, minification, and initialization

In this [1] I get the following in debug:

[org.apache.royale.core.View, 1, '_id', true, '$ID1', 0, 0, [components.MyComp, 2, 'id', true,
'myComp', 'myProp', true
this.myLabel.text = "myProp: " + this.myComp.myProp;

And this in release:


this.myLabel.text='myProp: '

So it looks like myComp.myProp is renamed to when reading, but not when writing.

If I change the code from

                                public var myProp:Boolean = false;

                                public var myProp:Boolean;

Then I get in release

this.myLabel.text='myProp: '+this.myComp.myProp

Which has correct behavior.


From: Alex Harui<>
Sent: Monday, December 4, 2017 7:14 PM
Subject: Re: MXML attributes, minification, and initialization


What is the generated data structure for that property?  How does the
generated data structure differ if the property is getter/setter?


On 12/4/17, 3:30 AM, "Yishay Weiss" <> wrote:

>We ran into an interesting problem with minification. If you have a
>component with an attribute that’s initialized like this:
>public var myProp:Boolean = false;
>and you try to initialize it from mxml (<comp myProp=”true”/>) the result
>will be myComp == true in debug and myComp == false in release.
>We found 2 ways around that: either don’t initialize (public var
>myProp:Boolean) or use get/set methods instead.
>I’m not sure what’s going on there but it’s something to watch out for.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message