How urgent is this?  I'm trying to figure out why the compiler did not
respond properly to bad MXML.

I thought public APIs were all exported so they would survive getting
renamed.  In the minified JS, the code will often access the renamed
variable, but a tree of objects with properties also gets created.

-Alex

On 7/10/17, 2:12 AM, "Harbs" <harbs.li...@gmail.com> wrote:

>It appears that this is the case with any public static getter.
>
>public static function get FOO():String{return “foo”}
>or
>public static function get FOO():Foo{return _foo}
>
>I don’t see any reason why bracket notation would be needed. Is this a
>throwback from before we had the get__ functions?
>
>Thanks,
>Harbs
>
>> On Jul 9, 2017, at 11:27 PM, Harbs <harbs.li...@gmail.com> wrote:
>> 
>> I just discovered something:
>> 
>> Foo.as:
>> package com.acme.foobaz.model{
>>      [Bindable]public class Foo{
>>              static public const BAZ:String = “baz”;
>>      }
>> }
>> 
>> In some other class:
>> 
>> if(baz == Foo.BAZ){//do something}
>> 
>> compiles to:
>> if(baz == com.acme.foobaz.model.Foo[“BAZ”])
>> 
>> If you remove the [Bindable] meta tag on the Foo class, it compiles to:
>> if(baz == com.acme.foobaz.model.Foo.BAZ)
>> 
>> In the debug build, these two are functionally identical. However, when
>>Google minifies the file, it has no way of knowing that Foo.BAZ is used.
>>This results in calling  (assuming com.acme.foobaz.model.Foo becomes k)
>>k.BAZ even though k.BAZ was optimized away and k.BAZ is undefined.
>> 
>> Why does [Bindable] on a class cause the bracket notation to be used?
>> 
>> Harbs
>

Reply via email to