On 2/17/16, 10:46 PM, "omup...@gmail.com on behalf of OmPrakash Muppirala" <omup...@gmail.com on behalf of bigosma...@gmail.com> wrote:
>On Feb 17, 2016 10:38 PM, "Alex Harui" <aha...@adobe.com> wrote: >> >> Hi Lizhi, >> >> Your email did not format well, but IMO, you are seeing expected >>behavior >> in the Google Closure Compiler optimization. Unless you specify >> otherwise, the GCC will rename variables, properties, etc. Using >>straight >> up JSON can be tricky in such situations. You may have to specify and >> even use a class definition for the JSON data structure. > >This is interesting. Is there an example of this kind of pattern >somewhere in the FlexJS examples? I think in FlexJSStore. The JSON data is supposed to be an array of Product instances. The inclusion of Product.as keeps its public properties from being renamed. Really, the uber-thought for FlexJS in general (with Advanced Optimizations) is to not use un-typed references. I still have on my to-do list a compiler option that spits out a warning whenever something resolves to one of a list of "untyped" types (Object, EventDispatcher, IEventDispatcher). I've been told that it is astounding how often we lose the higher-level type via our APIs. If you use event.target or event.relatedObject, you've lost the higher-level type. -Alex