On Fri, Dec 7, 2012 at 10:12 AM, Erik de Bruin <e...@ixsoftware.nl> wrote:

> adobe.classes["com.example.components.MyTextButton"]
>  = com.example.components.MyTextButton;
> [#Remove line, obsolete]
>

I think I can imagine why the original author (Bernd?) added this output.
Using nested JavaScript objects to represent packages is nice, because it
resembles the ActionScript syntax, but has a runtime penalty for nested
packages (serveral property accesses instead of one) which may be hard to
optimize for GCC. Also, it pollutes the global scope, because all top-level
packages (here: "com") are added as properties of the global object.
Imagine someone calls a package "alert.acme.flex"!
Thus, it could be an option to only add packages to a global PACKAGES hash
(which is in turn inside the "apacheflex" namespace or whatever we'll name
the global framework object), and only copy those packages/classes to the
more JavaScript-friendly format which are "exported".

Reply via email to